Skip to content
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

[QUESTION] Are items in TokenCache case insensitive? #546

Closed
Jeffery-Wasty opened this issue Sep 29, 2022 · 3 comments
Closed

[QUESTION] Are items in TokenCache case insensitive? #546

Jeffery-Wasty opened this issue Sep 29, 2022 · 3 comments
Assignees
Labels
Question Any questions about how MSAL Java works

Comments

@Jeffery-Wasty
Copy link

A user is proposing a change for the MSSQL-JDBC driver, where retrieval from cache is case-insensitive, as opposed to case-sensitive as we have it now. My question is, are items stored in the cache also case-insensitive? Using the example the user provides, would [email protected] be stored as [email protected] by MSAL4J? Thanks!

@Avery-Dunn
Copy link
Collaborator

Hello @Jeffery-Wasty : Items in the cache are case sensitive. MSAL Java caches data taken directly from the tokens, and when looking up cached info we just check if information provided matches what we have cached and return the exact info we got from tokens/app devs/users/etc.

So, things like usernames or emails would depend on what is in the ID token that the token service gives us. For example, if the ID token has [email protected] in the 'preferred_username' field, we'd cache it with the capital 'J' and 'C', and we would return [email protected] when you call the getAccounts() method.

@Avery-Dunn Avery-Dunn self-assigned this Oct 5, 2022
@Avery-Dunn Avery-Dunn added the Question Any questions about how MSAL Java works label Oct 5, 2022
@siddhijain
Copy link
Contributor

Closing due to inactivity. Please reopen this issue for more questions.

@Jeffery-Wasty
Copy link
Author

Jeffery-Wasty commented Dec 22, 2022

@Avery-Dunn

I'm confused about this then:

accountCacheEntity.userAssertionHash().equalsIgnoreCase(userAssertionHash);
. It looks like what is being fetched uses a case-insensitive match?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Question Any questions about how MSAL Java works
Projects
None yet
Development

No branches or pull requests

3 participants