Is there an LDAP standard group membership attribute for users? - active-directory

I'm currently working on an application which uses LDAP as an authentication method. I was wondering if the LDAP protocol has a standard membership attribute which would hold the user's group? So far memberOf is working in OpenLDAP and Active Direcotry but not in Apache DS. I couldn't find this attribute in the RFCs so I'm kind of confused. Should I be using the memberOf attribute or I need to go the old fashion way traversing over all of the groups to find which group has the member?

By the standards, only the member attribute on the group (as used by Microsoft Active Directory) can be "counted" on.
RFC 4519 section 2.17 states:
"The 'member' attribute type contains the distinguished names of objects that are on a list or in a group. Each name is one value of this multi-valued attribute."
The memberOF (used by Microsoft Active Directory) and groupMberShip (used by eDirectory) are implementation specific attribute added to the user.
The memberOF (used by Microsoft Active Directory) attribute is controlled by the server and is not modifiable. (flagged as Read Only from LDAP and System-Only in MS speak)
-jim

Related

user principal name issues and LDAP

So... this question is maybe not solely a programming question but I hope one of you can shed some light on my issue:
The base need we have in our software is to query the groups a user is associated too with
LDAP. For this task we actually use parts of LDAP Admin to query the user. Actually we want to query for the UserPrincipalName which at least to my knowledge is the most common way right?
So.. our problem is that the AD is setup such that the user has an UPN like foo#HUS
but the user actually is bound to the domain HUS.adomain.com (aka LDAP base: dc=HUS,dc=adomain,dc=com) and searching using an UPN like foo#HUS.adomain.com does not work - only foo#HUS works. So... the question is:
Is this common?
And is there a name/resource for that?
(sorry I'm quite new to that all...)
The goal would be to use as less parameters in the administration tool as possible
aka only the base (and form from the base the UPN username).
Update: I found at least one resource (in German) that states that this is possible but not recommended by Microsoft for Azure AD. (aka having a different mail address than UPN )
When you initiate a LDAP search using a UPN like foo#HUS.adomain.com it wont work because this value is not present in the userPrincipalName value. When you search for a user by building its UPN using all the domain suffix available in the forest, then you would not consider searching the userPrincipalName attribute.
It is very difficult to build every constructed attribute from base for querying because every Active directory environment would be different. As you have mentioned that you would like to build the attribute from base, it may work if this is the only AD infra that you are targeting. Every AD infra would have its own ways in which it will be setup.
However if you would want your tool to work in any AD environment you would have to consider some other parameters.
UPN is a editable attribute . An organization can set it up or can create a user without a UPN value. Below is example of user created programmatically by using old ADSI libraries. You can repro the same by removing any users userprincipalName attribute value and the user logon account name as shown in the pictures below.
UPN is an optional attribute and a user account can be present in AD without it as well. Coming back to your specific environment in this environment only foo#HUS works because "HUS" might be setup as a valid domain suffix within the Active directory. You can check this by opening the domain.msc console on any domain controller or a machine with Remote Server Administration Tools installed. You would find the UPN suffix as shown below . I changed it in my environment as shown below.
The value you will add will now show up in the . If you remove HUS from here for example any existing user who have user#HUS userPrincipalName populated will get removed because this is a optional constructed attribute in AD. And you will have to setup this for all the users in the environment . For example check below after I changed the username to dh # HUS .
The userprincipalName value also got populated with the same.
Hope this helps clarify your query and understand more on how to use the native Active directory tools to understand more while you develop your custom LDAP search functionality/tool.

Scoping filter for user provisioning based on group membership

We have an enterprise application in our Azure AD tenant where we have enabled automatic user provisioning to provision users in the external service. We have assigned several groups to the application, and the provisioning scope is set to Sync only assigned users and groups. This currently provisions all users in the groups assigned to the enterprise application.
We would like to add an additional scope filter, so that we can provision members of the assigned groups that is also a member of a different group (which is not directly assigned to the enterprise application). I've looked at adding a scope filter, but none of the available attributes seems to be usable for checking group membership. I imagined I would find something like an isMemberOf target attribute, but this does not seem to exist.
Is is possible to achieve such scope filtering?
As the article said, The IsMemberOf filter is not supported currently.
Attribute mappings for groups: Provisioning of the group name and group details, in addition to the members, if supported for some applications.
The following is groupt attribute mapping:

What Fields in Active Directory Are Not Only Unique, But Also Immutable (ADFS)

I've been looking for a way to identify a user in Active Directory without fail. I found this article which explains which fields are unique. It's a good starting point, but doesn't identify which fields are non-mutable. Further google queries result in AzureAD results on immutableId, which is what I want, but for regular AD. The case I'm trying to prevent is I use sAMAccountName (which is unique) to identify a user, but an admin decides to change the sAMAccountName for some reason (perhaps for uniformity) and I identify the same old user (with now a new sAMAccountName as a new user.
A few contenders from the article:
DN
UPN
sAMAccountName
ObjectGUID
Is there anything I'm missing? Is there an immutableId equivalent in pure AD (Not AzureAD)?
What you likely want is objectGUID. As "GUID" suggests, it is "globally unique". It doesn't change, even when the account is moved to another domain.
There is also objectSid (SID = Security Identifier), which is what Windows permissions use (the SID is stored in the permissions). It is also globally unique, but part of the SID is the SID of the domain. So if the account is moved to another AD domain, a new SID is generated on that domain, and the old objectSid is put in the sIDHistory of the new account.
There is some extra reading about that here: Security identifiers and globally unique identifiers
The distinguishedName changes whenever the account is renamed or moved to a new OU.
As you noted, both userPrincipalName and sAMAccountName can change too.

memberOf attribute in Active Directory does not contain all user groups

I have made an application, where I want to bring all the user accounts and their memberships in the Active Directory Environment. I came to know that a user in Active Directory has memberOf attribute which stores the distinguishedName of the groups of which a user is a member.
However, when I checked out and found the memberOf isn't all the groups of which user is a member of. For example, it only contains few distinguishedName of the groups in other domain of same forest.
Am I missing something ? Is there some configuration which has to be done on Active Directory.
Please note, I am using Java JNDI for bringing the users form the active directory.

UnboundID LDAP: memberOf filter not synchronising users

Apologies for the newbie question, fairly new to LDAP and UnboundID.
I currently have an UnboundID filter that synchronises users who belong to an Active Directory group.
--set include-base-dn:cn=Users,dc=testdomain,dc=net --add "include-filter:(memberOf=CN=Application Access,CN=Users,DC=testdomain,DC=net)
The behaviour I am seeing is that when I add a user to the group "Application Access", no Synchronisation occurs.
However if I edit the users AD profile whilst they are a memberOf "Application Access" then the user profile is synchronised.
Is is possible to synchronise users when they join a group?
Thanks in advance.
In Microsoft Active Directory the MemberOf value is the DN of an entry that the current entry is a member in a Group and is referred to as a Forward Reference.
A Pseudo Attribute Microsoft Active Directory
MemberOf is a Pseudo Attribute. This implies You can not monitor the MemberOf attribute for changes (Like with DirXML)
Within Microsoft Active Directory MemberOf is flagged as "NO-USER-MODIFICATION" (or System-Only)[1]; This means you can NOT update the attribute. In order to add a user to a group you have to write the user's dn to the member attribute on the group object.
-jim

Resources