-
Notifications
You must be signed in to change notification settings - Fork 148
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
Follow up to question to: Are items in TokenCache case insensitive? #578
Comments
Hello @lilgreenbird! Looking closely at your question and the MSAL Java implementation, you are correct that the keys used to put and retrieve tokens to and from the token cache are case insensitive as they are converted to lowercase throughout the code. Does that work for you if the user is looking for a case-insensitive match? Are you proposing any changes to the MSAL Java implementation? |
hi @siddhijain This is a bug as in linux/mac user names are case sensitive they could be different users so could be a security issue. We have an issue opened on this (original external issue here ) As you can see So yes we would request this to be fixed, the MSAL library should use the username as provided and not do any conversions. |
@lilgreenbird Sure, we will discuss and work on fixing this. |
@lilgreenbird After discussing with our PM, this looks like an intended behavior and not something that can be fixed in msal4j. msal4j does not deal directly with the username. It uses Azure AD tokens to populate the cache ( and username is one of the values in the token). Let us know if there are more questions. |
hi @siddhijain I'm not sure what you mean that msal4j does not deal directly with the username? That is the account name in the cache that's passed by the JDBC driver (provided by the user) to MSAL. If I set the user name to |
@lilgreenbird MSAL Java does not convert the username to lowercase. The library passes the information received to ESTS for token acquisition. This conversion might happen at ESTS. You are correct that AAD usernames are not case-sensitive so abc@microsoft.com and Abc@microsoft.com are the same users. I will see if I can find any documentation around this. Hope that helps. Thanks. |
thank you, we will update our driver accordingly to account for case insensitivity then. |
This is a follow up to #546 which was closed. Apologies for inactivity since we were focused on releases last few weeks. Please see original issue in https://youtrack.jetbrains.com/issue/DBE-13085.
Here is where we get the account cache from MSAL in the JDBC driver.
Looking through the MSAL code it looks like matches are not case sensitive here? and here? I also see that toLowerCase is called in AccountCacheEntity.
We're seeing that if the user string is
JohnnyCash@folsom.org
we're gettingjohnnycash@folsom.org
back from getAccounts(). User is proposing that we do case insensitive match and consider that as a hit however linux/mac is case sensitive these could be 2 different users.The text was updated successfully, but these errors were encountered: