Skip to content
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

Support for ldap #6

Open
linden5 opened this issue Mar 7, 2019 · 10 comments
Open

Support for ldap #6

linden5 opened this issue Mar 7, 2019 · 10 comments

Comments

@linden5
Copy link

linden5 commented Mar 7, 2019

I want to use ldap to log into Apostrophe, and have tried passport-ldapauth. But I found that there seems only to be support for passport strategies based on passport-oauth2.
Though I solved the problem by extending passport-ldapauth myself, is it possible to add support for other passport strategies not based on passport-oauth2 officially?

@punkhub
Copy link

punkhub commented Mar 7, 2019 via email

@punkhub
Copy link

punkhub commented Mar 7, 2019 via email

@linden5
Copy link
Author

linden5 commented Mar 8, 2019

That's right, I wrapped it in a new strategy that looks more like passport-oauth2 from the outside. The keypoint is adding username, displayName to user profile, and passing it properly to the verify function returned by the method findOrCreateUser.
I think your design is reasonable since oauth2 is widely used.
I will post my code later. Thank you for your reply.

@boutell
Copy link
Contributor

boutell commented Mar 8, 2019 via email

@linden5
Copy link
Author

linden5 commented Mar 11, 2019

I've committed my code here. If you have any suggestions, please let me know.

@linden5
Copy link
Author

linden5 commented Mar 14, 2019

After investigating further, I found apostrophe-ldap-login. While it solves my problem, extra work is needed to create users.

@punkhub
Copy link

punkhub commented Mar 14, 2019 via email

@boutell
Copy link
Contributor

boutell commented Mar 18, 2019

Did you abandon your own solution to use apostrophe-ldap-login somehow (you'd have to port it to 2.x)? Curious how this worked out for you.

@linden5
Copy link
Author

linden5 commented Mar 19, 2019

No, I didn't abandon my own solution. I left my previous comment before actually trying that module or taking a look at the source code. I should have been more rigorous.

@boutell
Copy link
Contributor

boutell commented Mar 19, 2019 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants