-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LDAP error Unable to extract user primary group with gidNumber attribute from user entries with ActiveDirectory #342
Comments
@rseaman2016 The error I must say I am not very familiar with Active Directory… Is there any other attribute that holds the user primary group? I don't even know if the notion of primary group is actually relevant in Active Directory. Do you know more than me on this matter? |
Hi @rezib, There is the GID attribute, but that accepts a group name, not a number. "Domain Users" is the default primary group, but is not populated in gidNumber by default. Microsoft even has a note about it: Usage of the gidNumber attribute is definitely configured per-application. For example, our primary storage appliance has never relied on the gidNumber attribute to determine the primary group. However, we recently added the gidNumber attribute to all users because a secondary storage appliance we recently deployed requires the gidNumber attribute to be populated in order to complete the ldap query. |
I also read about the primaryGroupID user attribute, which is a group number. According to the documentation I found, the gidNumber is a group attribute. Don't you have this |
Thanks for the link. As the documentation mentioned, users primaryGroupID is set to the default RID for Domain Users, but my understanding is that gidNumber is used for posix-compatible applications, similar to the uidNumber attribute. |
My understanding is that the issue could be fixed by making gid attribute name configurable in RFL |
I'm not sure, especially since doing a bit more testing actually came back with some interesting results. I changed the user_base variable to an OU further down where there happens to only be one user, and was able to return the gidNumber attribute successfully. However, I then ran into this Python error:
I then updated the user_base variable to an OU where there are 7 users and was able to return the gidNumber attribute for only the first user, then returned the same error above. So querying the gidNumber attribute seems to be working, just not for all users. The Python error is curious since we've clearly already authenticated against the domain controllers. |
Looking back at the output when using the original user_base, I realized that the employee that comes up in the query before the "Unable to extract user primary..." error is a former employee, and therefore didn't have the gidNumber attribute populated when we recently added that to all (enabled) accounts. I'm not quite sure how that fits in to the Python error, but I'm guessing it's returning that because it's only querying one user before bombing out and since the one user happens to not have the gidNumber attribute populated, we get the exception from ldap.py:
|
Then I guess RFL and Slurm-web should give the possibibility to configure custom primary group attribute in user entries AND support user entries without primary group attribute. It should not fail in the second case, just keep on searching for other (secondary) groups. What do you think about this proposal? |
I don't think we necessarily need to have a custom primary group attribute, as (assuming we are shooting for POSIX-style attributes), gidNumber seems to be the correct attribute to use, based on a couple of examples below: https://cloud.google.com/architecture/partners/netapp-cloud-volumes/ad-ldap-posix The ability to support user entries without the gidNumber attribute would be important, as I can imagine plenty of AD environments don't have that set (we didn't until last week). I'd have to test once we get the fixes for this current issue in place, but we might also allow customization of the group_class at ldap.py, line 159, as AD groups have an objectClass of group. That's something I've had to change on some LDAP-backed applications before, when the default is posixGroup. Thanks for all your help with this! |
OK, I see, thank for your insightful feedback! I just opened 3 RFE for RFL:
The current issue will track addition of corresponding parameters in Slurm-web gateway configuration files and documentation update. |
I went ahead and stood up a Rocky 9 server for the gateway and I'm still having issues with authentication against Active Directory. For the sake of troubleshooting, I statically set sAMAccountName in place of uid in ldap.py. This got me a new error:
[ERROR] ⸬slurmweb.apps.ldap:45 ↦ LDAP error: Unable to extract user primary group with gidNumber attribute from user entries
Navigating to the login page and entering credentials, I get:
Thanks!
Originally posted by @rseaman2016 in #340 (comment)
The text was updated successfully, but these errors were encountered: