Re: LDAP returns wrong members
- From: Alexey Smirnov <alexey.smirnov@xxxxxxxxx>
- Date: Thu, 12 Feb 2009 09:56:43 -0800 (PST)
On Feb 11, 3:47 pm, "Joe Kaplan"
<joseph.e.kap...@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:
The problem is most likely that the other members of the group are members
via primary group membership. That is not stored in the member attribute of
the group. Instead, the RID of the group is stored in the primaryGroupID
attribute on the users. As such, you must use a different technique to find
users who are members of the group via primary group membership.
In general, you don't want to implement logic like this by reading the
members of the group. Instead, you should calculate the user's full group
membership. This fits more neatly with the standard .NET
IPrincipal.IsInRole approach to authorization. Additionally, it is easier
to get the user's full security membership via LDAP by reading the
tokenGroups attribute. This is fairly well-documented and is demonstrated
in several different ways in ch 10 of my book which is a free download from
the website in my sig. This type of approach can be turned into an ASP..NET
role provider as well. My co-author started one of these at
codeplex.com/adrp
HTH,
Joe K.
--
Joe Kaplan-MS MVP Directory Services Programming
Co-author of "The .NET Developer's Guide to Directory Services Programming"http://www.directoryprogramming.net
Basically what I wanted to get is why it is not working in general. We
have few internal web based applications that used AD membership to
authorize intranet users (using LDAP queries) and recently we
recognized that this is working properly for some of our groups. So, I
want to fix this for all applications, including LDAP Browser.
Our AD has been recently migrated to Win2008. I think before this (on
Win2000) it was working correct.
Joe, I appreciate your help, thank you. I changed my code to a
tokenGroups attribute and it is working properly now. Regarding LDAP
and "memberof" values: why it shows 60 users then? As far as I see
they also have that group as a primary group and according to your
answer this should not work. Is it a kind of obsolete information,
which is not updated, or it is an error in our directory? Is there any
tool to look for errors in AD / or refresh LDAP? :-)
.
- Follow-Ups:
- Re: LDAP returns wrong members
- From: Joe Kaplan
- Re: LDAP returns wrong members
- References:
- LDAP returns wrong members
- From: Alexey Smirnov
- Re: LDAP returns wrong members
- From: Paul Bergson [MVP-DS]
- Re: LDAP returns wrong members
- From: Alexey Smirnov
- Re: LDAP returns wrong members
- From: Joe Kaplan
- LDAP returns wrong members
- Prev by Date: how to find a GAL entry in AD
- Next by Date: Auditing Directory service access
- Previous by thread: Re: LDAP returns wrong members
- Next by thread: Re: LDAP returns wrong members
- Index(es):
Relevant Pages
|