Skip to content

SharedTokenCacheCredential defaults to the "common" tenant without the option to change that #11549

Closed

Description

  • 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

Metadata

Assignees

Labels

Azure.IdentityClientThis issue points to a problem in the data-plane of the library.customer-reportedIssues that are reported by GitHub users external to the Azure organization.feature-requestThis issue requires a new behavior in the product in order be resolved.

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions