N
naijacoder naijacoder
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?
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?