Skip to content

ASP.NET with windows-authentication and authorization via web.config

May 14, 2018

Recently I experienced problems with getting windows-authentication and authorization to work with web.config. So here is a reminder.

This did not work, gave a logon-prompt:

<configuration>
    <system.web>
        <authentication mode="Windows" />
        <authorization>
             <deny users="*" />
             <allow roles="The-Domain-Group-You-Are-Member-Of" />
        </authorization>
    </system.web>
</configuration>

I had to switch order of the tags, like this:

<configuration>
    <system.web>
        <authentication mode="Windows" />
        <authorization>
             <allow roles="The-Domain-Group-You-Are-Member-Of" />
             <deny users="*" />
        </authorization>
    </system.web>
</configuration>
Advertisements
Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

%d bloggers like this: