KEMBAR78
Use lowercase environment value during searching by rayluo · Pull Request #831 · AzureAD/microsoft-authentication-library-for-python · GitHub
Skip to content

Conversation

@rayluo
Copy link
Contributor

@rayluo rayluo commented Jun 13, 2025

Context: The "environment" field in the token cache contains an authority's domain name, which is stored as lowercase in cache. We did that right. But we noticed that when performing a search in the token cache, we were not converting the "environment" field to lowercase. This is usually not a problem, because the domain name is typically in lowercase. And no customer reported any issue. However, recently when we are running Managed Identity test cases on Windows, we found out that the domain name placeholder that we use, turns out to be mixed case on Windows, such as "CPC-raylu-UB85C". This would cause cache miss when running the Managed Identity client on a Windows machine.

This PR improves the token cache search/match logic to always search environment by lowercase.

@rayluo rayluo requested a review from a team as a code owner June 13, 2025 18:45
@rayluo rayluo force-pushed the lowercase-instane-name branch from ad317f4 to a2a772e Compare June 14, 2025 02:27
@rayluo rayluo force-pushed the lowercase-instane-name branch from a2a772e to b1d8cd7 Compare June 14, 2025 02:35
@rayluo rayluo merged commit b1d8cd7 into dev Jun 20, 2025
19 checks passed
@rayluo rayluo deleted the lowercase-instane-name branch June 20, 2025 22:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants