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

From: Edward J. Stembler (ejstembler_at_hotmail.com)
Date: 08/08/03

  • Next message: Chris DuBuc: "Newbie Hello World Authentication Issue"
    Date: 8 Aug 2003 13:12:00 -0700
    
    

    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");
    }


  • Next message: Chris DuBuc: "Newbie Hello World Authentication Issue"

    Relevant Pages

    • Re: Windows Authentication - what happens when its not available?
      ... If you hit a windows authentication page without the appropriate credentials, you will automatically be prompted with a login box, to enter your information. ... so that the network users don't have to log onto the ... > network and Intranet seperately. ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: user name in database!
      ... David Wier ... I'm wondering how to do this, I'm working on the on a datagrid and I'm ... using windows authentication. ... And the Login page looks like on: ...
      (microsoft.public.dotnet.framework.aspnet)
    • "Predicting" authorization?
      ... >to re-architect our company's intranet in .NET. ... >authentication and authorization scheme is really ... >Windows authentication. ... >the intranet has the necessary functionality they need. ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • user name in database!
      ... I'm wondering how to do this, I'm working on the on a datagrid and I'm ... using windows authentication. ... I managed to get username on to a login ... And the Login page looks like on: ...
      (microsoft.public.dotnet.framework.aspnet)
    • Windows Authentication Question for ASP
      ... If I set up Windows Authentication for an Intranet ... based on their current network connection? ... In other words, if I log into my LAN with DANNYL, ...
      (microsoft.public.dotnet.framework.aspnet.security)