Working with IIS7 Authentication and WCF

Damir Dobric Posts

Next talks:

 

    

Follow me on Twitter: #ddobric



 

 

Archives

When hosting your service in IIS, sometimes you may decide to protect it by using of for example Basic Authentication. In this case I assume that secured transport (ssl) is used, because the username and password are base64 encoded (clear text).

Unfortunately, in this case you may get following error, which can be confusing:

Server Error in '/' Application.


Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.NotSupportedException: Security settings for this service require 'Anonymous' Authentication but it is not enabled for the IIS application that hosts this service.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

This error appears if you have setup your IIS-application to use Basic Authentication only (Anonymous Authentication is disabled).

image

Usually the error will appear in this case if you have configured an additional endpoint which requires anonymous authentication, like MexHttpBindig.

Solution

1. Enable Anonymous authentication (required by MEX-Binding) or
2. Remove MEX-Binding from configuration file.


Posted Dec 23 2008, 10:50 PM by Damir Dobric
Filed under:
developers.de is a .Net Community Blog powered by daenet GmbH.