Ask a Question related to ASP.NET Security, Design and Development.
-
Chris #1
Help with IsInRole
Hi,
I am using windows integrated authentication aon my intranet. How do I check
if a user is a member of a group in active directory. I have the foll test
code but it's not working
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click
If User.IsInRole("USA\Administrators") Then
TextBox2.Text = ("Role: Administrator").ToString
Else
TextBox2.Text = ("Unable to check Role").ToString
End If
End Sub
note: usa is name of my domain
I get the second message "Unable to check Role". The Windows Authentication
works great. If i use
TextBox1.Text = User.Identity.Name
I get the correct logged on user. The only problem here is checking the
role/group in active directory.
Thanks
Chris Guest
-
IsInRole Performance Issue
Hi, We have a very large AD here and I am noticing that the WindowsPrinciple IsInRole function is taking upwards of 1 second to respond with just a... -
WindowsPrincipal.IsInRole() is Being Flaky. Help!!
Its just being inconsistent. I'm in 3 different Groups in AD. ..IsInRole("Groupx") returns true ..IsInRole("Groupy") returns true... -
isInrole
I am using isInRole function to check if a user is in a group. It works ok except it will suddenly stop working and I will have to reboot to get it... -
Problems with IsInRole
I'm having problems with WindowsPrincipal.IsInRole. It's returning false when it should return true. I've written some test code that uses... -
User.IsInRole not redirecting
Hi there, I have been reading up on Authorization and role based security for a couple of days now, and am trying to implement this in my... -
Joseph E Shook [MVP - ADSI] #2
Re: Help with IsInRole
Administrators is one of the special BUILTIN Group. It is like a
localized kind of special domain. On your web server it is most likely
added to the users session token when authenticated against IIS because
the user is a member of your USA\Domain Admins group which has been
added to your Web Servers BUILTIN\Administrators group. If that is the
case then use:
User.IsInRole("BUILTIN\Administrators")
In C#
User.IsInRole(@"BUILTIN\Administrators")
Or you can use User.IsInRole("USA\Domain Admins").
But there is no USA\Administrators group available at the web server.
Joseph E Shook [MVP - ADSI] Guest
-
Chris #3
Re: Help with IsInRole
Thank you sir!
"Joseph E Shook [MVP - ADSI]" wrote:
> Administrators is one of the special BUILTIN Group. It is like a
> localized kind of special domain. On your web server it is most likely
> added to the users session token when authenticated against IIS because
> the user is a member of your USA\Domain Admins group which has been
> added to your Web Servers BUILTIN\Administrators group. If that is the
> case then use:
>
> User.IsInRole("BUILTIN\Administrators")
>
> In C#
> User.IsInRole(@"BUILTIN\Administrators")
>
>
> Or you can use User.IsInRole("USA\Domain Admins").
>
> But there is no USA\Administrators group available at the web server.
>
>
>
>
>
>
>
>Chris Guest



Reply With Quote

