WindowsPrincipal.IsInRole() problem with non-builtin roles

From: naijacoder naijacoder (naijacoder_at_toughguy.net)
Date: 08/30/04

  • Next message: Nathan Dawson: "Use RegEx with a Web Control"
    Date: Sun, 29 Aug 2004 23:53:10 -0700
    
    

    Can't get WindowsPrincipal.IsInRole() to work for me when using
     Windows Authentication. Here's a snippit of code from my C#
     codebehind page:
     
     WindowsPrincipal wp = new WindowsPrincipal(
     WindowsIdentity.GetCurrent() );
     lblUser.Text = wp.Identity.Name;
     Label1.Text = wp.IsInRole(@"DOMAIN\group").ToString();
     
     
     where "DOMAIN\group" is a valid group name. The username shows up
     correctly as "DOMAIN\username" but for any non-builtin roles,
     IsInRole() returns false. Does anyone have suggestions as to why this
     is not working?
     

    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!


  • Next message: Nathan Dawson: "Use RegEx with a Web Control"

    Relevant Pages

    • Re: WindowsPrincipal.IsInRole() problem with non-builtin roles
      ... When using Windows authentication in ASP.NET, ... > codebehind page: ... > IsInRole() returns false. ...
      (microsoft.public.dotnet.framework.aspnet.security)
    • Re: Displaying different content on one Asp.net page(populated from a DB)
      ... Thx alot but i have a question for you:- ... Windows Authentication. ... Here's a snippit of code from my C# ...
      (microsoft.public.dotnet.framework.aspnet)
    • Re: PlaySound
      ... Perhaps you mean "SystemStart" and not "Start Windows" ... Frank Hickman ... Here is a snippit of the "window proc": ...
      (microsoft.public.vc.language)
    • Re: General questions about LDAP, GC and access permissions
      ... Windows Communication Foundation) they are authenticated with the regular ... this is done by examing what groups the user is a member of. ... Since the regular windows authentication is used, ... trusted domain in an external forest. ...
      (microsoft.public.windows.server.active_directory)
    • Re: Help please to authenticate Windows users
      ... status error code as well as Win32 error code -- I know the HTTP status code ... Windows Authentication automatically works if the machines are joined to the ... Is VS.Net on the same machine as IIS ...
      (microsoft.public.inetserver.iis.security)