strongloop / loopback-component-passport

LoopBack passport integration to support third party logins and account linking
Other
139 stars 227 forks source link

Add group search support for LDAP Authentication #247

Closed felixmueller1 closed 6 years ago

felixmueller1 commented 6 years ago

Description

The used LDAP package vesse/node-ldapauth-fork supports group search capabilities. Once an authentication was successful an array of groups will be added to the user record. Sample output with groups:

{ dn: 'uid=fadams,o=greenwell',
controls: [],
givenname: 'Frank',
uid: 'fadams',
cn: 'Frank Adams',
_groups:
[ { dn: 'cn=PortalAdmins,o=greenwell', controls: [] },
{ dn: 'cn=ConnectionsAdmins,o=greenwell', controls: [] } ] }

Currently only the first element of the _groups array is used by loopback. Since _groups is a hardcoded reference in node-ldapauth-fork we can use the same hardcoded reference in our code.

Checklist

slnode commented 6 years ago

Can one of the admins verify this patch? To accept patch and trigger a build add comment ".ok\W+to\W+test."

raymondfeng commented 6 years ago

ok to test