-
Notifications
You must be signed in to change notification settings - Fork 427
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
Fixed Azure Active Directory user name cache matching to be case insensitive #1923
Conversation
See https://youtrack.jetbrains.com/issue/DBE-13085 The problem is that server reply is cached and user input is searched
Thank you, we'll take a look into this. |
Hi @kassak, An update. We're not 100% sure on the behavior of MSAL4J and case-sensitivity. Depending on the answer we receive from the team, this may or may not be a JDBC issue. We'll keep you updated on the status of the issue. |
I'd like to note that the problem may lay deeper:
|
The reply from MSAL is that the items cached are case-sensitive, and so we shouldn't be looking up with equalsIgnoreCase. You explicitly describe an issue where you looked up |
If there is some sort of case mismatch between driver and msal, we can look into it more. But for now (1) it doesn't appear to be an MSAL problem, and (2) we need to confirm this caused the original issue mentioned in the thread [MFA Azure support causes multiple browser tabs to open] |
While investigating the issue, I've created a patched jar with extended logging (also in my patch)
Further attempts
So the cached e-mail, thus the one returned by server is Can I help you with anything else? |
We haven't been able to look at this during the last week. We'll try looking at this as soon as we can. I'm still a bit confused on how this links to the original issue you posted. Is it that, because of the casing, users are not being authenticated properly, and this causes a window pop up asking them to reauthenticate? |
Nope, on the contrary. The user authenticates ok, using CamelCase login, but the reply contains it in lower case. So on the next connection that reply is not found in cache and authentication is requested once again. Making cache case insensitive helped our users |
Okay, thank you for clearing that up. |
I wasn't able to do this on my end, can you remove the logging? Just the casing fix would be all that is needed here. |
hi @kassak we can not have this change in the driver as usernames are case sensitive in linux/mac they could be different users. I have confirmed this is a bug (see AzureAD/microsoft-authentication-library-for-java#578) in the MSAL library we will wait for this to be fixed there. |
re-opening PR as Azure ActiveDirectory user names are not case sensitive and MSAL library converts to lower case |
/azp run public-mssql-jdbc.linux |
Azure Pipelines successfully started running 1 pipeline(s). |
See https://youtrack.jetbrains.com/issue/DBE-13085
The problem is that server reply is cached and user input is searched
We've been able to track the situation where user entered
JohnnyCash@folsom.org
and cache containedjohnnycash@folsom.org
-> cache missI've done the quickfix by using case-insensitive comparison.
I'm not aware if the logins are truly case-insensitive. Feel free to make the fix of your own :)