-
Notifications
You must be signed in to change notification settings - Fork 3.3k
{Core} Only pass data to MSAL as kwargs
#30062
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -57,12 +57,13 @@ def signed_session(self, session=None): | |||||
| def get_token(self, *scopes, **kwargs): | ||||||
| logger.debug("CredentialAdaptor.get_token: scopes=%r, kwargs=%r", scopes, kwargs) | ||||||
|
|
||||||
| # SDK azure-keyvault-keys 4.5.0b5 passes tenant_id as kwargs, but we don't support tenant_id for now, | ||||||
| # so discard it. | ||||||
| kwargs.pop('tenant_id', None) | ||||||
| # Discard unsupported kwargs: tenant_id, enable_cae | ||||||
| filtered_kwargs = {} | ||||||
| if 'data' in kwargs: | ||||||
| filtered_kwargs['data'] = kwargs['data'] | ||||||
|
|
||||||
| scopes = _normalize_scopes(scopes) | ||||||
| token, _ = self._get_token(scopes, **kwargs) | ||||||
| token, _ = self._get_token(scopes, **filtered_kwargs) | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As of this PR, it looks like we don't need that
Suggested change
Open question: Currently there are multiple Even if we somehow still want to accept and then ignore arbitrary parameters, a more readable pattern is
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The reason why I don't use As for not making
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Fair enough. In that case, I would suggest you put that reasoning as a comment at the line of
Good point. This PR is ready to go as-is, without AzureAD/microsoft-authentication-library-for-python#755 (If we are really going to expose that in MSAL, we will revisit its naming.)
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I am the only one maintaining this part. Let's keep it as is, as I will change it soon.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. One silly question, are
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We only support |
||||||
| return token | ||||||
|
|
||||||
| def get_auxiliary_tokens(self, *scopes, **kwargs): | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
claimsis a supported keyword argument ofUserCredential.get_token:azure-cli/src/azure-cli-core/azure/cli/core/auth/msal_credentials.py
Line 55 in 95ef126
Not passing
claimsbreaks CAE silent re-authentication. Interestingly, no issue is reported. 🤔