vesse / passport-ldapauth

LDAP authentication strategy for Passport
MIT License
312 stars 100 forks source link

Get Nested Groups #75

Closed umerkk closed 5 years ago

umerkk commented 6 years ago

I am using passport-ldapauth with my NODEJS+ExpressJS application. I am trying to get the list of all NESTED membersOF the authenticated user but couldnt figure out how to do it.

My User "X" has a membership of "ROL-B" and ROL-B has membership of other 10 groups. Now after authentication when it returns me the authenticated user object, i only see ROL-B as members of the group. Is there any way i can get the full list of nested groups that a user belongs?

Here is my configuration "adAuthConfig": { "url": "ldap://localhost:8076", "bindDn": "CN=svcAccount,OU=Services,OU=Accounts,DC=misd,DC=net", "bindCredentials": "XXXXXXXXXXXXXXX", "searchBase": "OU=Accounts,DC=misd,DC=net", "searchFilter": "(userPrincipalName={{username}})" },

vesse commented 5 years ago

No idea. Better check with StackOverflow

bluEEil commented 5 years ago

I have been working with this package for a while now, and I recently got the need for getting authenticating the user with its nested group (and not just direct groups). This sounds like something very basic that must be supported (for this package to make any sense and be usable). It is very weird if this is not supported, since if a user is memberOf a group, and that group is a member of a more basic group, it makes zero sense that the user can't authenticate as a member of that basic group.

Has there been any changes on this regard? I do know about this package supporting this: https://github.com/gheeres/node-activedirectory/blob/master/lib/activedirectory.js#L732 But I'm already working with ldapauth (and I want my code to be ldap generic and not AD specific), it will be very weird to me if I have to switch to that module for such basic behavior.

@vesse There is nothing in StackOverFlow about this. Could this be reopen and maybe handled in some way?