Authenticate with E-mail instead of AD username with LDAP enabled
Expected Behavior (or desired behavior if a feature request)
Feature Request: Not sure if this has already been done, but I would like to be able to have our users log in using their e-mail address instead of Active Directory username with ldap enabled. We have lots of other systems using their e-mail address so they get "confused" if it's not that...
I have attempted changing the LDAP username field to mail and LDAP Authentication query to mail= in the Settings ->LDAP Settings and it does not seem like changing those allows using e-mail for authentication instead of samaccountname
Actual Behavior
Any changes I've attempted I get:
production.ERROR: There was an error authenticating the LDAP user: Could not find user in LDAP directory in the logs.
Please confirm you have done the following before posting your bug report:
- [x] I have enabled debug mode
- [x] I have read checked the Common Issues page
Please provide answers to these questions before posting your bug report:
-
Version of Snipe-IT you're running: v3.6.6 build 1 (gee2c67a)
-
What OS and web server you're running Snipe-IT on: Centos and Nginx
-
What method you used to install Snipe-IT (install.sh, manual installation, docker, etc): install.sh
-
WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error: No Error message from Debug. Just log message saying user not found.
-
What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error: login page
-
If a stacktrace is provided in the error, include that too: N/A
-
Any errors that appear in your browser's error console.: none
-
Confirm whether the error is reproduceable on the demo: N/A
-
Include any additional information you can find in
app/storage/logsand your webserver's logs: production.ERROR: There was an error authenticating the LDAP user: Could not find user in LDAP directory in the logs. -
Include what you've done so far in the installation, and if you got any error messages along the way N/A
-
Indicate whether or not you've manually edited any data directly in the database: Nope
It feels like this should already be possible with the configuration options available, but I cannot get it to work, either. I'm not particularly interested in this feature myself, but just wanted to test it and provide this note:
I would suggest using the proxyAddresses attribute instead of the mail attribute with an LDAP query like (proxyAddresses=SMTP:$EMAIL_ADDRESS).
This would allow for people to also use any email aliases that they have, as well. In my organization, everyone has 2 email addresses by default. The nice thing about the proxyAddresses query is that even though it's a multi-valued attribute, the query will still match the account with the specified address as any one of those values.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!