Reputation: 31
I want to enabled only "anonymous authentication" in IIS 7.0 with the change in configuration file(web.config). We are doing the packaging of wcf service and we want to disable all the authentication mode and just want to enable the "anonymous authentication". Is it possible to do it just by web.config and without using IIS user interface.
I have tried following piece of code but it is not working :
<authentication mode="None" />
<authorization>
<allow users = "?" />
</authorization>
**ignore typos
Upvotes: 3
Views: 4904
Reputation: 1798
You can do this by adding the following child tag to <system.webServer>
tag of your web.config:
<security>
<authentication>
<anonymousAuthentication enabled="true" />
<basicAuthentication enabled="false" />
<digestAuthentication enabled="false" />
<windowsAuthentication enabled="false" />
</authentication>
</security>
I am assuming that Anonymous is the only authentication mode that you require for this web app.
For these web.config settings to take effect, Authentication settings delegation should be set up on the IIS server level.
Select your IIS server node, then Feature Delegation and make sure that all types of Authentications are in Read\Write delegation mode:
Upvotes: 1