Closed
Description
openedon May 20, 2020
- Package Name: identity
- Package Version: 1.4.0b4
- Operating System:
- Python Version: 3.7
Describe the bug
In SharedTokenCacheCredential _get_auth_client() creates an AadClient with tenant_id="common". All subsequent calls to get_token() will use this tenant, which might not be the tenant for which the token should be obtained. Hence SharedTokenCacheCredential is unusable for all other tenants.
Expected behavior
SharedTokenCacheCredential should work for the tenant specified by shared_cache_tenant_id.
Additional context
The fix is to change in the SharedTokenCacheCredential class (in _credentials and aio_credentials) the _get_auth_client() function to use as first argument of AadClient():
tenant_id=self._tenant_id if self._tenant_id else "common"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment