- Package Name: azure-identity
- Package Version: 1.23.0, 1.23.1
- Operating System: Ubuntu 22.04
- Python Version: 3.13.4
Describe the bug
In the file azure/identity/aio/_credentials/on_behalf_of.py, within the function _request_token (line 122), the call to get_cached_refresh_tokens is missing the kwargs argument. This results in an empty cache when enable_cae is set to True.
To Reproduce
Steps to reproduce the behavior:
- Set
enable_cae=True when obtaining a token using the OnBehalfOfCredential.
- Observe that token caching does not work as expected.
- Investigate the code path in
_request_token and note that kwargs is not passed to get_cached_refresh_tokens.
Expected behavior
The cache should store and retrieve tokens correctly when enable_cae is enabled.
Additional context
Pass kwargs to get_cached_refresh_tokens in _request_token to ensure the cache key includes relevant options like enable_cae.
Reported based on direct code inspection and observed behavior.
File: azure/identity/aio/_credentials/on_behalf_of.py
Function: _request_token (line 122)
Impact: Token cache miss when enable_cae=True.
Describe the bug
In the file
azure/identity/aio/_credentials/on_behalf_of.py, within the function_request_token(line 122), the call toget_cached_refresh_tokensis missing thekwargsargument. This results in an empty cache whenenable_caeis set toTrue.To Reproduce
Steps to reproduce the behavior:
enable_cae=Truewhen obtaining a token using theOnBehalfOfCredential._request_tokenand note thatkwargsis not passed toget_cached_refresh_tokens.Expected behavior
The cache should store and retrieve tokens correctly when
enable_caeis enabled.Additional context
Pass
kwargstoget_cached_refresh_tokensin_request_tokento ensure the cache key includes relevant options likeenable_cae.Reported based on direct code inspection and observed behavior.
File:
azure/identity/aio/_credentials/on_behalf_of.pyFunction:
_request_token(line 122)Impact: Token cache miss when
enable_cae=True.