Security – Anonymous Authentication / 403 – Forbidden: Access is denied

appcmdiisiis-7.5Securitywindows-server-2008-r2

I am using windows server 2008 R2 and IIS 7.5

I deployed my app to that server for the first time and I got the following error;

403 – Forbidden: Access is denied.

You do not have permission to view
this directory or page using the
credentials that you supplied.

so I make a little search on that and I figured that I should configure Anonymous Authentication <anonymousAuthentication> but I don't know how to do that. It is clearly explained on the following link but not sure if this is the right solution to my problem;

http://www.iis.net/ConfigReference/system.webServer/security/authentication/anonymousAuthentication

if this is the problem, I guess, I should put a similar code block as follows;

<security> 
  <authentication>
   <anonymousAuthentication
      userName="User1"
      password="[enc:AesProvider:57686f6120447564652c2049495320526f636b73:enc]" />
   </authentication>
</security>

if this is the case, how should I provide this code?

should I use AppCmd.exe with powershell?

EDIT
ok, I continue to explore and new questions pops up on my head;

  1. As far as I got, I need to set machine username and password there. but what kind of user should I set there? where should user have access (which folders)?
  2. can I add that configuration inside my web.config file or should I provide this inside applicationHost.config?

Best Answer

Replace <security> </security> in your applicationHost.config with

<system.webServer>
    <security>
        <authentication>
            <anonymousAuthentication enabled="true" />
        </authentication>
    </security>
</system.webServer>

You should be able to configure the same from IIS Manager as well using link