Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
In configuring this connector for use with our FreeIPA ldap server we found that we were unable to authenticate using an email address even though the FreeIPA configuration supports it. After working with the auth0 support team, ticket #02310390, it was determined that the email authentication may be failing due to the fact that the connector defaults to anonymous search if that is enabled on the server even if bind credentials are specified. This is likely due to the limited amount of user data provided by the server under anonymous search. I did some testing and found that if the bind credentials were used instead of anonymous search then the email authentication would succeed. In our case, we are unable to disable anonymous search at this time on our FreeIPA server due to several factors so, we needed a different solution.
What I came up with is this pull request which adds a setting to the config.json named
LDAP_PREFER_BIND_CREDENTIALS
. When set to true, and with just a few lines of code changed, the communication with the ldap server is done via the specifiedLDAP_BIND_USER
andLDAP_BIND_PASSWORD
rather than the anonymous search.References
https://support.auth0.com/tickets/02310390 - not sure if you're able to access the support ticket from that link, but there it is anyway.
Testing
This was tested in our environment by replacing
lib/ldap.js
andserver.js
on our running connector with the versions in this pull request, prior to the change, authentication by email would always fail with the following message logged:After the files were replaced, authentication succeeds:
Checklist