By default when installing K2 SmartForms, the forms runtime site will be protected by Windows Authentication and require licensed users in K2 to access these forms. There are several scenarios you may have to make a secondary SmartForms Runtime site publicly accessible with no authentication and this quick blog post will show you how to perform these actions.
While the latest version of K2 SmartForms does have a new feature in the form designer properties to use the anonymous access property setting, this requires updates to each form which may be ideal in certain situations if you only want a few forms anonymous.
Steps to create a secondary SmartForms Runtime site for public (anonymous) access:
- Open Windows Explorer and navigate to “C:\Program Files (x86)\K2 blackpearl\” and copy the “K2 smartforms Runtime” folder and paste it into this same directory and then rename the folder to “K2 smartforms Runtime Public” or something else.
- Open IIS, and right-click on your SmartForms website and select “Add Application”
- In the dialog that opens, enter the Alias for this new site, such as ‘public’ and select the newly created directory from step #1 in the Physical path and click OK.
- Click on the newly created app in IIS manager, which should appear in the list under your SmartForms website and then double-click on the “Authentication” icon.
- Make sure “Anonymous Authenticaion” is Enabled (by default)
- Run Notepad as an Administrator and open the web.config file located in the new directory (app) you created in step #1, or click on new app from IIS and click the ‘Explore’ link in the Actions pane on the right side.
- Change the value for key ConnectAsAppPool to True
- <add key="ConnectAsAppPool" value="true" />
- Comment out (disable) the setting <deny users=”?” />
- <!-- <deny users=”?” /> -->
- Uncomment (enable) the setting <allow users=”*”/>
- Save your changes.
Please keep in mind that if you create this secondary K2 SmartForms Runtime site, when upgrading K2 SmartForms to a new version, the install wizard will NOT automatically upgrade the files in this manually created site. After upgrading, you will need to copy/paste the “K2 SmartForms Runtime” folder from the main installation folder to the location for the public access site.