ASP.Net Windows Authentication problem = Login dialog keeps popping up

  • Thread starter Edward J. Stembler
  • Start date
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");
}
 
E

Edward J. Stembler

Should I be using Forms-based authentication instead?

I think I read somewhere here that using Windows-based authentication
causes Windows to thrown a login dialog every time something needs to
be authenticated.

I only want the user to be authenticated once. I also need to be able
to tell if they are part of a certian NT user group (i.e.
"BUILTIN\Administrators" or "BUILT\Managers" etc...).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top