-
Notifications
You must be signed in to change notification settings - Fork 7
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 #7
base: master
Are you sure you want to change the base?
Conversation
Hi Jose, what does a complete configuration to use this feature look like? Are you still configuring it to use |
Hi Tom, maybe I wasn't explaining as well as I should, so I'm going to explain all step by step, so that it will be easier to understand.
Change in enablePassportStrategies function
Change in addLoginRoute function
New callback function to addapt LDAP profile and also pass parameters in a correct order
I also moved the implementation of findOrCreateUser function to another function so that there's no duplicated code between custom callback and ldapCallback. Finally, the problem is that if LDAP authentication fails, it send me to the failureRoute that I set before in the express route definition, but without the request and the response. So I couldn't redirect with the same user data to another strategy. Is it possible to recover the request or maybe to save this information temporarily? I hope, this answers all your questions. |
Thanks, this is very helpful. It sounds like we might be able to create some flags and other configuration options for the individual changes in behavior, and then have some presets that get activated based on the strategy name if it's one like LDAP that we know about. That's the direction I would like to see this take, rather than hardcoding a lot of if statements specifically for LDAP. |
That way, if someone wants to use a strategy we're unfamiliar with but the tweaks they need are similar to those needed for LDAP, they can set those flags. |
I've changed it. I used two different tags, the first to change the GET route to a POST route, and the second to change the callback method. |
This is a big step in the right direction. I'm thinking that the module should contain an object like this with preconfigured tweaks for modules that need them: self.strategyOverrides = {
'passport-ldap': {
postRoute: true,
mapFields: {
username: 'uid'
}
}
}; We would then merge these options in automatically so the developer doesn't have to tell us what we already know about I would think we can make a single |
Hi! I've implemented a LDAP support for this module.
The major doubt that I have with this implementation is about the modules names nomenclature, because it could be a little confusing, for example with implementFindOrCreateUser function.
I also want to comment a problem that I've found doing this implementation, and it's that I couldn't concat LDAP strategy with local strategy in the same button action, I mean, when LDAP's authentication failed, I couldn't recover the username and password introduced by the user before and try again with a local login. Is there any way with Apostrophe to recover this data or the last request?