E
Edward J. Stembler
I'm using Windows Authentication in my C# ASP.Net intranet
application. I have a "Delete" column in a DataGrid which I only want
displayed if the Windows user is a member of the "Administrators" or
"Managers" group. I have the code for that working, but when someone
else attempts to access my page they have to log in several times.
This doesn't happen if they log in as my local account
"MyDomain\MyUser". I've been playing around with various combinations
and cannot seem to get the login dialog to only appear once for them.
Anyone have any ideas?
Notes:
I have anonymous access turned off for my virtual directory in IIS (I
only want certain users having access)
I correctly have the users in my web config:
<authentication mode="Windows" />
<authorization>
<allow users="OurDomain\user1,OurDomain\user2,OurDomain\me" />
<deny users="*" />
</authorization>
I've tried turning impersonation on and off and chaning my Principle
code accordingly:
private bool hasDeleteRights()
{
IPrincipal id;
//id = new WindowsPrincipal(WindowsIdentity.GetCurrent()); //
<identity impersonate="true" />
id = User; // <identity impersonate="false" />
return id.IsInRole("BUILTIN\\Administrators") ||
id.IsInRole("BUILTIN\\Managers");
}
application. I have a "Delete" column in a DataGrid which I only want
displayed if the Windows user is a member of the "Administrators" or
"Managers" group. I have the code for that working, but when someone
else attempts to access my page they have to log in several times.
This doesn't happen if they log in as my local account
"MyDomain\MyUser". I've been playing around with various combinations
and cannot seem to get the login dialog to only appear once for them.
Anyone have any ideas?
Notes:
I have anonymous access turned off for my virtual directory in IIS (I
only want certain users having access)
I correctly have the users in my web config:
<authentication mode="Windows" />
<authorization>
<allow users="OurDomain\user1,OurDomain\user2,OurDomain\me" />
<deny users="*" />
</authorization>
I've tried turning impersonation on and off and chaning my Principle
code accordingly:
private bool hasDeleteRights()
{
IPrincipal id;
//id = new WindowsPrincipal(WindowsIdentity.GetCurrent()); //
<identity impersonate="true" />
id = User; // <identity impersonate="false" />
return id.IsInRole("BUILTIN\\Administrators") ||
id.IsInRole("BUILTIN\\Managers");
}