[Identity] Let GetTokenMixin.get_token pass kwargs to MSAL#16397
[Identity] Let GetTokenMixin.get_token pass kwargs to MSAL#16397jiasli wants to merge 2 commits intoAzure:masterfrom
Conversation
|
|
||
| def get_cached_token(self, *scopes): | ||
| # type: (*str) -> Optional[AccessToken] | ||
| def get_cached_token(self, *scopes, **kwargs): # pylint:disable=unused-argument |
There was a problem hiding this comment.
I think this is more complicated than the change itself:
- Service Principal credentials support
data, but - Managed Identity credentials don't. (They may support
datain the future.)
Making them share the same GetTokenMixin adds unused kwargs to ManagedIdentityClientBase.get_cached_token.
|
Whether a credential uses MSAL, and how, are implementation details. Routine maintenance makes it impossible to guarantee two versions of azure-identity will call the same MSAL methods, or require the same version of MSAL (see e.g. #16449). An application trying to pass arguments to an MSAL method through Whether we support acquiring SSH certificates is a separate question. We'll consider doing that in a future version. |
GetTokenMixinis inherited byClientSecretCredentialCertificateCredentialManagedIdentityCredentialHowever,
GetTokenMixin.get_tokendiscards**kwargswhen calling MSAL, making it impossible to get an SSH certificate with a Service Principal credential.After applying this PR, the network trace shows
req_cnfis sent correctly: