Tag Archive for 'web.config'

Domain user name issue in web.config for Windows authentication

Today one of my co-workers did the trouble shooting and resolved this stupid problem together with me, and suggested put on the blog to share it. So here we go.

To make one of our internal web application authentication method simply, I decided to use Windows authentication and put the only one user in the web.config. The following are what I put in the web.config:

<authentication mode=”Windows”  />
<authorization>
<allow users=”DOMAINNAME/USERID”/>
<deny users=”*”/>
</authorization>

But the web form won’t authenticate me even I put the right user name and password, a windows logon prompt always jumped out.

I changed to <deny users=”?” /> then everyone can get in.

By the way, I have made the change in IIS to disable the anonymouse authentication and enable the Integrated Windows Authentication.

Finally, we figure out that we used the wrong slash in the user name. We should use backward slash “\” instead of the forward slash “/”. The working code should be

<authentication mode=”Windows”  />
<authorization>
<allow users=”DOMAINNAME\USERID”/>
<deny users=”*”/>
</authorization>

Gosh, never paid attentions on it before. I used both of them in asp.net 1.1.

Related posts



Get Adobe Flash playerPlugin by wpburn.com wordpress themes