Is it possible to configure a Gen .NET Client/server application to use Windows Authentication in IIS?
When using the default Anonymous Authentication enabled in IIS the Gen sample model .NET client/server application functions correctly when a call is made to the server.
Anonymous Authentication was then disabled and Windows Authentication was enabled for the sample application i.e.
After that change, the flow to the server fails with:
TIRM037E: Fatal Error was encountered ***
TIRM157E: An unexpected exception was encountered during processing
[Function: NETDynamicCoopFlow::ProcessException]The remote server returned an error: (401) Unauthorized.
Release : 8.6
There is no formal support for Gen .NET client/server applications to use Windows Authentication in IIS. However, the following manual changes have been found to be successful.
1. Backup the existing files web.config and Global.asax in the application installation directory ("C:\Inetpub\wwwroot\<appname>" or other install directory e.g. for 32-bit sample model application default install directory is "C:\Program Files (x86)\Broadcom\sample")
2a. Create a new configuration file custom.config in the application installation directory with these 3 lines:
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
</configuration>
b. Copy the entire <system.runtime.remoting> section from the existing file web.config file (near the bottom) and place it within the above configuration tags i.e.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.runtime.remoting>
...
</system.runtime.remoting>
</configuration>
c. Change the line:
<channel ref="http">
to be:
<channel ref="http" useDefaultCredentials="true">
3. In the existing file web.config file:
a. Delete the entire <system.runtime.remoting> section that was copied to the new custom.config file.
b. At the start of the existing <system.web> section add these extra lines:
<authentication mode="Windows"/>
<authorization>
<allow users="*"/>
</authorization>
4. Edit the file Global.asax file to include the following two lines in the Application_Start method to use the new custom.config file for the remoting configuration:
string sPath = Server.MapPath("custom.config");
System.Runtime.Remoting.RemotingConfiguration.Configure(sPath);
5. Restart the IIS (Default) Web Site that is hosting the application.
The client application flow to the server should then execute successfully.
Example custom.config, plus original and modified web.config and Global.asax files are in the attached zip file.