3

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
prateek jain
  • 31
  • 1
  • 2
  • Duplicate [Enable Anonymous Authentication](http://stackoverflow.com/questions/10351075/allow-anonymous-authentication-for-a-single-folder-in-web-config) – nobody May 05 '16 at 15:34
  • This question is not the duplicate of [Enable Anonymous Authentication](https://stackoverflow.com/questions/10351075/allow-anonymous-authentication-for-a-single-folder-in-web-config). That question deals with a single folder in the application, this question asks about the whole application. – myroslav Sep 07 '18 at 21:00
  • Only IIS administrators can grant you the possibility to configure that in `web.config`, as by default such can only be configured in `applicationHost.config` so this question right now is invalid. – Lex Li Sep 07 '18 at 21:09
  • The OP did not specify any administrative restrictions imposed though. – myroslav Sep 07 '18 at 21:11

1 Answers1

1

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:

enter image description here

enter image description here

myroslav
  • 1,670
  • 1
  • 19
  • 40