Add username formatting option to support OpenLDAP and others #246
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.
While attempting to use LDAP auth with my OpenLDAP server, I ran into #230 as well. This PR is meant to add more flexible username formatting to support additional LDAP implementations.
This PR supersedes #242 as I discovered I really should have branched first.
I've also simplified the changeset somewhat, at the expense of a new "user-format" config entry being required (if preferred, I'm happy to change it back to the old approach of adding an getOptionalSetting).
I've also added a DEBUG log statement to print the username being used for the login, as well as additional examples and notes in the application.conf.
Note that these changes adjust the behavior of the email type username case such that user@test.com will be passed through unchanged rather than being converted to user@test.com@domain.com; I assume this is preferable to the old behavior.