-
Notifications
You must be signed in to change notification settings - Fork 898
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
Normalize the username entered at login to lowercase #15716
Conversation
LDAP does a case sensitive match of the user name but AD will do a case insensitive match. By normalizing the userid to lowercase when using external auth both backed to either an LDAP directory or AD both will authenticate but only one DB record, in all lowercase, will be created, even if the user attempted to login with a mixed case username when backed to AD. https://bugzilla.redhat.com/show_bug.cgi?id=1448787
@abellotti Please review |
@miq-bot add_label authentication, bug |
Checked commits jvlcek/manageiq@88a312c~...ce0513c with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 app/models/authenticator/base.rb
|
Is it possible for two users to have the same name but different case? e.g. bob and Bob ? |
@Fryguy that would be a bug. In fact that is the bug this PR is trying to address. :) But to your point, No, it is not possible for the same user to exist in the directory (Active Directory or LDAP) with the same name but with mismatched case. So there are 2 perspectives: This PR addresses #2 with the understanding that #1 is a tautology :) Thanks for the help! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Nice!
@jvlcek @gtanzillo there is a request to backport this to Fine branch. Is that ok? |
@simaishi I will put together the Fine backport PR. |
@jvlcek thank you. For tracking purpose, I've added fine flags. |
Backported to Fine via #15796 |
LDAP does a case sensitive match of the user name but AD will
do a case insensitive match. By normalizing the userid to
lowercase when using external auth both backed to either
an LDAP directory or AD both will authenticate but only one DB
record, in all lowercase, will be created, even if the user
attempted to login with a mixed case username when backed to AD.
https://bugzilla.redhat.com/show_bug.cgi?id=1448787
Steps for Testing/QA
Test the AD case:
Test the LDAP case: