Closed ionutchirvasa closed 8 years ago
@ionut72 Were you able to figure this out? If so, could you share? I've been researching this on and off for the last few weeks in my spare time, with no luck. I currently get a Failed to serialize user into session
error.
@danieltjewett
I was able to implement this feature using vesse/passport-ldapauth and created ./config/passport.js with a new provider( see issue #79 for more details).
The reason why you get that error is because you have no id attribute set to your returned user model. To fix this you have to call sails.services.passport.loadStrategies();
after sails boots in order to correctly load your custom ldapauth protocol(here you map LDAP result to you user schema).
I called loadStrategies in ./config/bootstrap.js like this:
sails.on('lifted', function() { sails.services.passport.loadStrategies(); });
To authenticate you have to use this route: /auth/:provider/callback
. I've created a new entry to allow POST requests.
Was anybody able to implement LDAP authentication?