Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Getting Group Membership

Reply
Thread Tools

Getting Group Membership

 
 
Dominick Baier
Guest
Posts: n/a
 
      09-12-2004
you have to query roles in the DOMAIN\GroupName format...



---
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

nntp://news.microsoft.com/microsoft.public.dotnet.framework.aspnet.security/<(E-Mail Removed)>

Hi,

I'm trying to do something that I think should be pretty easy, take the user who is authenticated with the application (intranet application/ integrated windows authentication), and determine if they are in "this group".

Before, I had queried active directory, got the list of groups for the user and compared, but then I realized that the IsInRole Function may actually work in this case. I tried it and it doesn't seem to be working correctly. Here is what I've tried so far.

I'm impersonating in my application, so I tried this....didn't work
Dim blah As WindowsPrincipal = New WindowsPrincipal(System.Security.Principal.Windows Identity.GetCurrent())
If blah.IsInRole("Domain Admins") = True Then
'is a domain admin
End If

Then I tried this:
If HttpContext.Current.User.IsInRole("Domain Admins") = True Then
'is a domain admin
End If

Still didn't return true (I am a member of this group too!) Am I missing something here, or so I just go back to querying active directory myself for group membership?

Thanks for any help!
--Michael

[microsoft.public.dotnet.framework.aspnet.security]
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Membership permissions after publishing an ASP.NET Membership site. Tino Donderwinkel ASP .Net 2 06-18-2008 08:16 AM
Help - Setting Up Authentication via Active Directory (Group Membership) for IPSEC and WebVPN Clients on VPN3K webspider Cisco 3 12-15-2004 04:35 AM
Getting Group Membership Raterus ASP .Net Security 2 09-10-2004 12:37 PM
Universal Group membership caching Chris Delsman MCSE 2 11-05-2003 08:51 AM
Checking group membership Jan Nielsen ASP .Net 0 09-02-2003 08:07 PM



Advertisments