ASP.NET membership. Can I enable anonymous access and use automatic logon with Active Directory?

I hope this is not paradoxical, but I do not know how this should be done ...

I have a VS2008 ASP.NET MVC Project with the following Web.Config entry:

  <authentication mode="Windows">
      <forms name=".ADAuthCookie" timeout="10" />
  </authentication>

      

This automatically allows the visitor to log in with their DOMAIN \ username, which they used to log in to Windows. (Right?)

This works with my development server ( http: // localhost: xxxx ) but not my IIS server ( http: // localhost ). Probably because the development server is "started" by my local user (who has ActiveDirectory read permissions on the domain) and because IIS is "started" by the IUSR_WORKSTATION user, which does not. (Right?)

If all of the above is true, how can I impersonate an IIS user (for example, for my own username) to fully authenticate the current user with a Windows login? (like example below)?

Or should user IUSR_WORKSTATION get ActiveDirectory? read permissions (not recommended, as I will often switch between IUSR_ servers / users)

<identity impersonate="true" userName="DOMAIN\myuser" password="mypass"/>
<authentication mode="Windows">
    <forms name=".ADAuthCookie" timeout="10" />
</authentication>
<identity impersonate="false"/>

      

+1


a source to share


1 answer


Windows Authentication is badly named (IMO). It does not use Windows as authentication, but rather delegates the authentication process to IIS. So you need to set up IIS authentication which then goes to ASP.NET



How you do this depends on your version of IIS, in IIS7 expand the tree and click on your website, then click Authentication and enable Windows Authentication

+2


a source







All Articles