You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Meanwhile, before this is implemented, Azure CLI developed its own multi-tenant authentication implementation using CredentialAdaptor.get_auxiliary_tokens (#19853):
@rayluo, do you think if it is possible for MSAL to accept tenant_id in acquire_token_silent_with_error, as in Azure CLI's implementation, get_token is just a wrapper of acquire_token_silent_with_error:
Another possible solution is we simply discard tenant_id in get_token, just as what we are doing right now - Azure CLI uses the current subscription for authentication. The down-side is that if the keyvault doesn't belong to the current subscription, authentication will fail:
> az keyvault key create --name "key1" --protection software --ops encrypt decrypt --vault-name "jlkv1"
(Unauthorized) AKV10032: Invalid issuer. Expected one of https://sts.windows.net/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/, https://sts.windows.net/f8cdef31-a31e-4b4a-93e4-5f571e91255a/, https://sts.windows.net/e2d54eb5-3869-4f70-8578-dee5fc7331f4/, found https://sts.windows.net/ca97aaa0-5a12-4ae3-8929-c8fb57dd93d6/.
Code: Unauthorized
Message: AKV10032: Invalid issuer. Expected one of https://sts.windows.net/54826b22-38d6-4fb2-bad9-b7b93a3e9c5a/, https://sts.windows.net/f8cdef31-a31e-4b4a-93e4-5f571e91255a/, https://sts.windows.net/e2d54eb5-3869-4f70-8578-dee5fc7331f4/, found https://sts.windows.net/ca97aaa0-5a12-4ae3-8929-c8fb57dd93d6/.
Context
azure-identity
introduced its new multi-tenant authentication APIget_token(tenant_id=...)
:Meanwhile, before this is implemented, Azure CLI developed its own multi-tenant authentication implementation using
CredentialAdaptor.get_auxiliary_tokens
(#19853):azure-cli/src/azure-cli-core/azure/cli/core/commands/client_factory.py
Lines 180 to 189 in 110f7b4
This makes
CredentialAdaptor.get_token
incompatible withazure-identity
'sInteractiveCredential.get_token
which takestenant_id
and resolves it athttps://github.com/Azure/azure-sdk-for-python/blob/01d0b99e53a1995b39e59649bf3d550dc5408875/sdk/identity/azure-identity/azure/identity/_internal/msal_credentials.py#L62
TODO
CredentialAdaptor.get_token
should be able to taketenant_id
.References
azure-keyvault-keys==4.5.0b4
#20880az keyvault key create
fails: Session.request() got an unexpected keyword argument 'tenant_id' #20856The text was updated successfully, but these errors were encountered: