I authenticate the user in the WCF service through IIS7 using Windows authentication and ASP.NET impersonation.
When debugging locally, I can see System.Security.Principal.WindowsIdentity.GetCurrent (). Name as equal to my Windows credentials. When I deploy this service to the server, WCF does not start if anonymous authentication is enabled.
So, how do we get this WCF service to run on a server with anonymous authentication disabled ?
UPDATE 1 : error message after trying both sentences:
The authentication schemes configured on the host ("IntegratedWindowsAuthentication") do not allow the "WebHttpBinding" ("Anonymous") binding parameters to be configured. Verify that SecurityMode is set to Transport or TransportCredentialOnly. In addition, this can be resolved by changing the authentication scheme for this application through the IIS management tool, through the ServiceHost.Authentication.AuthenticationSchemes property in the application configuration file on the item, updating the ClientCredentialType property on the binding, or by setting the AuthenticationScheme property to HttpTransportBindingElement.
UPDATE 2 . Authentication was established as follows:
Application pool:
- Identity = NetworkService
Web site:
- Anonymous Authentication = Disabled
- ASP.NET Authentication = Enabled
- Windows Authentication = Enabled
WCF application:
- Anonymous Authentication = Disabled
- ASP.NET Authentication = Enabled
- Windows Authentication = Enabled
source share