Skip to content

Conversation

@rayluo
Copy link
Contributor

@rayluo rayluo commented Jul 1, 2024

The self._get_access_token() uses token key to find a token in O(1) time complexity. However, previously we forgot to also use self._is_matching() to double check the other criteria such as scopes and - in this bugfix's case - the key_id claim. This PR refactors the implementation to call self._is_matching() in both the O(1) code path and the traditional O(N) code path.

This shall fix a recent bug report of false-positive cache hit for Ssh Certificate acquisition.

Install this by python -m pip install --force-reinstall "git+https://github.com/AzureAD/microsoft-authentication-library-for-python.git@bugfix-token-cache-search". Merged to dev now.

Thanks for the testing done by @vthiebaut10 , this PR will fix Azure/azure-cli#29006

@rayluo rayluo marked this pull request as ready for review July 3, 2024 17:27
@rayluo rayluo requested a review from a team as a code owner July 3, 2024 17:27
@rayluo rayluo merged commit c1fedad into dev Jul 3, 2024
@rayluo rayluo deleted the bugfix-token-cache-search branch July 3, 2024 17:30
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.

az ssh arc connection issue using Service Principal

3 participants