-
Notifications
You must be signed in to change notification settings - Fork 836
Conversation
…r each time they login. added some documentation on LDAP configuration
@ammmze , thanks for the contribution, i'll test it and provide some feedback if needed before merging |
@ammmze , please resubmit the pull req to https://github.com/pantsel/konga/tree/ldap-integration |
@pantsel FYI...this is the docker-compose.yml file I used for testing this:
I just setup the ldap instance via the ui. I setup a In the end it looked something like this: |
Hmm...so actually...I just realized the group checking isn't working. Basically it is currently letting any user who has an account login. |
Err...never mind...group checking is working. I had assumed that by setting admin=false, they would not be able to login. But without the appropriate group, they just get a read-only view. Perhaps we should add something additional for a user check, so that you can restrict read-only access as well? |
@ammmze appreciate if you have a casual minute for a 4 year ago thing yah made! Any idea what is happening here? I am no MS AD LDAP expert by any means...
After a successful login: Was trying to use your LDAP integration logic:
Leaving all other vars as default. For 2 microsoft ad groups to be allowed in as admins(and I know I have those groups as well). Based on the output I am guessing my BIND DN and Pass are good for connecting to the LDAP HOST, my user search base must be working likely too to have gotten by the login. My group search base must likely be the missing component here and why my user ended up as just a "basic" non admin user in limbo... In some old java code with an LDAP dependency I remember we did it like this to make a list of user groups to eval for authz: |
Hey @jeremyjpj0916 ... TBH I'm not much of an LDAP guy either and where I work we never ended up using this. But looking through it, I'm not sure if the group search base is correct. It looks like you have it the same as the user search base. From what it looks like, it looks like it is expecting to do a search in collection of things that returns groups, not users. And then it does adds to the query a filter to filter the groups by the user using the |
Thanks for your input, yeah I am on the same page I think my group search base is indeed incorrect, will try to get clarification from our internal LDAP management team on what it should look like. |
@ammmze Hmm maybe microsoft ad ldap isn't compatible w this actually I am thinking. Takes a query like this(via CLI):
To get results of a given user details with a memberOf list(microsoft ad groups):
If there was then a way per user to get the memberOf list to parse for admin access I imagine the KONGA_ADMIN_GROUP_REG field would be like:
For example giving the first 2 groups in the list admin access. I don't think there is a way in ms ad ldap to lookup all groups and filter on a user context, I think the lookup is by user which will include memberOf groups list. Will confirm this with a team tomorrow. Time to sleep lol. Edit, maybe I could add Seems you do have a memberOf bit here: https://github.com/pantsel/konga/pull/238/files#diff-14af2ae5fc48c68823060898a6ddbc038b04a417647f50ae2736f9bc68d33a7cR54 , need to understand how its all connected though. |
Well I can search on a specific group by CN Seems:
Wonder if there is compatibility I could work with here by isolating my group search to a singular group I want members to be a part of without having to change your code impl... |
If anyone else uses MS AD LDAP and needs guidance I found a pattern that works for me so throwing it here incase it helps any weary traveler, caveat being it limits you to 1 group to do admin access control but it works!
What I think it does is: 1 user search makes sure valid user.
Then the REGEX is just a match all, meaning if we got proper data of any kind back then user met the criteria, its not pretty but did work for me and distinguish regular users from admin users via a MS AD LDAP group. Phew this took awhile to crack but found a hacky way to make it work for me. |
I've taken LDAP code started here and tested it out and make some additional changes. This addresses #230