Re: WindowsPrincipal.IsInRole() problem with non-builtin roles
From: Joe Kaplan \(MVP - ADSI\) (joseph.e.kaplan_at_removethis.accenture.com)
Date: 08/30/04
- Next message: Hernan de Lahitte: "Re: WindowsPrincipal.IsInRole() problem with non-builtin roles"
- Previous message: Faassen, B.: "Re: BUG With FormsAuthentication"
- In reply to: naijacoder naijacoder: "WindowsPrincipal.IsInRole() problem with non-builtin roles"
- Next in thread: Hernan de Lahitte: "Re: WindowsPrincipal.IsInRole() problem with non-builtin roles"
- Reply: Hernan de Lahitte: "Re: WindowsPrincipal.IsInRole() problem with non-builtin roles"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Mon, 30 Aug 2004 09:29:04 -0500
When using Windows authentication in ASP.NET, the WindowsPrincipal for the
logged in user is in the HttpContext.User property, not the
WindowsIdentity.GetCurrent(). They are the same IF you are impersonating,
but otherwise they are not.
HTH,
Joe K.
"naijacoder naijacoder" <naijacoder@toughguy.net> wrote in message
news:urYFE4ljEHA.3536@TK2MSFTNGP12.phx.gbl...
> 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: Hernan de Lahitte: "Re: WindowsPrincipal.IsInRole() problem with non-builtin roles"
- Previous message: Faassen, B.: "Re: BUG With FormsAuthentication"
- In reply to: naijacoder naijacoder: "WindowsPrincipal.IsInRole() problem with non-builtin roles"
- Next in thread: Hernan de Lahitte: "Re: WindowsPrincipal.IsInRole() problem with non-builtin roles"
- Reply: Hernan de Lahitte: "Re: WindowsPrincipal.IsInRole() problem with non-builtin roles"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|