-
Notifications
You must be signed in to change notification settings - Fork 985
memberOf with groupOfUniqueNames not working #304
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
Comments
@ookerberry works perfectly well for me (tested on Docker for MacOSX):
Full search output and ldif file available here |
It does not work for me as well. Latest openldap from docker, seems to be UPD: the output is the same, I don't get |
@ookerberry @vityafx could you please post the complete output of slapcat run within your container |
@ookerberry @vityafx may be you could also try my initial ldif file from here |
@obourdon I am sorry, but I have no interest in spending time on it right now. I have a lot of my own stuff to do, so I pass. I hope someone else will help you. From my side, I can say that |
@vityafx no problem and many thanks for your answer. Hopefully this now seem to work for you. Will still dig into this later on to see if I can find something worth mentioning |
@obourdon I really apologize for not helping you now, I would like to help. I am also not that good with ldap and don't even know about this I remain subscribed to this issue, so once I know I can help you or anyone else experiencing this problem, I'd post a comment for sure. |
@vityafx do not worry, I am definitely no expert either, just may be a little bit more advanced than you are right now. In my case, I just need to use this container as a replacement for a full fledge mail system that I built several years ago which relies on LDAP for (virtual)mail accounts, forwarding, permissions, vacations, ... moving away from process based baremetal installation to docker on cloud ;-) |
+1 for memberOf support |
@HariSekhon sorry if it is not clear for me. Does your +1 means that memberOf support works well for you ? |
per the configuration, it is supposed to work with groupOfUniqueNames |
Same issue for me on macos with osixia/openldap:1.2.4 the overlay only works for groupOfNames/member, but not working for groupOfUniqueNames/uniqueMember |
@obourdon I can confirm that "memberOf" only works for groupOfUniqueNames and not for groupOfNames. Which log output do you need to investigate this problem? |
@westwin @drhuh, guys from what you are respectively writing, it seems to me that you are contradicting each another. Doing more tests on my side showed that @drhuh is right (like @quanah also suggests in its own post) @drhuh sorry but I have not enough expertise in this area to tell you if this can be debugged/fixed/relative to docker container or openldap itself |
I have tested and it is working for me with groupOfUniqueNames however... I was hoping it would resolve nested groups and it is not. Is it supposed to and not working, or not supported? |
@nick-randal There is no support for "nested" groups in OpenLDAP, if by that you mean groups of groups. |
Note, that's specifically because of the way it's implemented in docker-openldap. You can see this in the link I referenced. If the configuration was modified to use groupOfNames/member, then it should work with those types of groups. It should generally be possible to do that with an ldapmodify after the fact. |
this is not working for me also i tried to add new group using the command below
and got the following errors in phpldapadmin dashboard
i really want to get this memberof to work but i dont understand why it is such a problem especially knowing that apps want to use it and i mean this is supposed to be an ldap server, ofcourse people need to know what groups users belong...it is beyond ,e why this does not work out of the box |
Do i apply this ldif for i have tried and i get these errors
|
The LDIF isn't literal (it has variables that need substitution fixing), and I assume it's applied as a part of the Osixia install process. I would suggest checking your existing configuration to see if it's already there. |
This error is correct. Your entry clearly violates the requirements for a groupOfUniqueNames object. I suggest reading the schema. |
how do i check if its there? where do i look? and how do i apply if not there? what do i change? |
this is what others have said worked for them...so not sure what violates..if you have the right way to do it can you post so i can get the help i need and i will really appreciate it..thanks |
Generally, one can read the related RFCs, or look at the schema files themselves. For example, if you look at the core schema file that ships with OpenLDAP, you can trivially find the definition for the groupOfUniqueNames objectClass:
As you can see, "gidNumber" is not a valid attribute for this objectClass. |
slapcat -n 0 -l /tmp/config.ldif Will export your current cn=config configuration to a file in LDIF format. You'll likely need to run the command as root. |
where do i get this file from or content of the file |
The slapcat command I listed will create /tmp/config.ldif when run. Please see the slapcat(8C) man page if you have questions on how slapcat functions. |
why does memberof not come by default? this is one thing i can never understand..i mean this is ldap server why does it not come with memberof by default as many apps need it? why does this need additional setup to work? why? why? why? never will understand that..been a pain to get it to work..days of back and forth and still not working. |
you dont use Osixia docker but you in the issue responding to questions? |
@encryptblockr We get a lot of unhappy users of Osixia who come to the OpenLDAP project email lists complaining, so I do my best to keep them off the list by answering questions here as much as I can since the OpenLDAP project has no links to Osixia. |
@quanah your help to answer user questions is very appreciated, thanks :) |
@BertrandGouny Definitely. :) The more that can be resolved here the better the product is, and the happier everyone's experience becomes. |
@BertrandGouny willing to help with my issue with memberof? and why it is not enabled by default? cant find any guide with exact steps to enable it..always bunch of craps everywhere and one has to put thing together by oneself |
@encryptblockr Reading through startup.sh, it looks like you need to add a line there to add the memberOf overlay (Similar to what's done on 304 for 02-security.ldif). There are plenty of valid reasons why one would not want memberOf enabled at all, and I think it makes a sane default to have it optional. |
what command do i run to add memberof overlay? if i just want to enable it after i started the container |
Generally, it looks like you could do something like:
|
ok i ran this and when i checked the content of
i followed this guide https://tylersguides.com/guides/openldap-memberof-overlay/ for having below and after following the link https://tylersguides.com/guides/openldap-memberof-overlay/ when i run this
so what do i do from here? seems memberof is enabled but its not working still |
If you want to match the Osixia configs, you're going to need to slapcat your config db, fix up the mess that's been made of the moduleload section, and update the module's configuration accordingly. |
ok will start from scratch and try your approach |
here is a fresh setup
now whats is next? any sample ldif file i can apply and use to test this thanks again for your help |
Generally the next step would to be to create a group using the groupOfUniqueNames objectClass that has at least one member defined in the uniqueMember attribute. If it's functioning, that should "magically" add memberOf to the members of the group. |
Your previous bit was mostly correct. Something like
should work, assuming that jdoe DN exists, etc. |
ok here is what i have now i imported this ldif
but when i try to run ldapsearch to find groups users are member of, i am not getting what i want. So not working.
also did i do anything wrong? thanks |
Yes, this is incorrect. The uniqueMember attribute takes the DN of an entry. The user DNs in your database that you show are:
But what you put in uniquemember is:
The above do not appear to be valid DNs for your database. The term "DN" has an exact meaning. Overall, I would strongly advise taking some time to read up on LDAP terminology and structure. |
@quanah still does not work here is what i have now
|
I've done the following: a) Load the memberof configuration as provided by Osixia:
b) Load your database:
Now, this fails to generate memberOf because you created the users after you created the groups. This is one of the distinct failings of memberOf in its current form -- Users must exist in the database prior to them being added to a group for the overlay to work. Now if I modify the groups:
The memberOf attribute is correctly created:
|
@quanah |
Hi @quanah! I also have setup the latest osixia/docker-openldap and memberOf with groupOfUniqueNames is working out of the box. This is my LDAP Export:
Best regards |
Nested groups requires OpenLDAP 2.5 and the slapo-dynlist overlay as a replacement for the broken slapo-memberOf overlay. |
Thank you @quanah! |
When it's ready. Which depends on how quickly the development team makes it through the open issues for 2.5. |
@joaqquin89 - From the looks of that screenshot, I'd say you should be getting the Care to share your |
Output snip:
|
If that helps anyone having the "memberOf should be true" issue : After a group import (usually when it's done before creating the users specified as uniqueMember), LDAP is unable to refresh the memberOf values. you have to modify and update each groups to update the memberOf index. |
It seems from the comments on #49 that memberOf is included in this docker image and should be working as long as the group is of objectClass: groupOfUniqueNames and if each member of the group is a uniqueMember.
Is this right?
I am not getting any memberOf info when I search.
Here is an example of an LDIF to add a group and member:
dn: cn=admin,ou=groups,dc=example,dc=com
objectClass: groupofuniquenames
cn: admin
description: Admin users
uniquemember: uid=john,ou=users,dc=example,dc=com
Here is an example of how I'm searching:
ldapsearch -x -D cn=admin,dc=example,dc=com -w admin -b dc=example,dc=com -h 127.0.0.1 uid=john memberOf
The output is just:
dn: cn=john,ou=users,dc=example,dc=com
but I'd expect it to be:
dn: cn=john,ou=users,dc=example,dc=com
memberOf: cn=admin,ou=groups,dc=example,dc=com
Should this be working or am I doing something wrong?
The text was updated successfully, but these errors were encountered: