-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Reimplement AadClient without msal.oauth2cli #11466
Conversation
sdk/identity/azure-identity/azure/identity/_credentials/authorization_code.py
Show resolved
Hide resolved
sdk/identity/azure-identity/azure/identity/_credentials/authorization_code.py
Show resolved
Hide resolved
@@ -1,6 +1,10 @@ | |||
# Release History | |||
|
|||
## 1.4.0b4 (Unreleased) | |||
- `azure.identity.aio.AuthorizationCodeCredential.get_token()` no longer accepts | |||
optional keyword arguments `executor` or `loop`. Prior versions of the method |
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.
executor
& loop
were already in 1.3.1?
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.
Yes, they've been around since 1.0.0b4.
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.
So do we really want 1.4.0 to break 1.3.1?
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.
As I wrote at the top of this PR, these arguments never worked. Trying to use them just raises exceptions.
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.
So the behavior is
Raise exception -> silently ignored?
We should add it into Breaking Change section
sdk/identity/azure-identity/azure/identity/_internal/shared_token_cache.py
Show resolved
Hide resolved
sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py
Outdated
Show resolved
Hide resolved
…into fix_annotation_initial_response * 'master' of https://github.com/Azure/azure-sdk-for-python: Adding digital twins CI configuration. (Azure#11730) Sync eng/common directory with azure-sdk-tools repository (Azure#11692) Reimplement AadClient without msal.oauth2cli (Azure#11466)
Upcoming features need an Azure AD client which separates acquiring tokens from caching them. We have two Azure AD clients,
AuthnClient
andAadClient
, both of which require reshaping to meet this new requirement. I chose the latter because it has a simpler API. Its implementation, however, is quite complex and usesmsal.oauth2cli
, which the MSAL team doesn't consider public. So this PR takes the first step toward supporting new features by simplifying the implementation and removing usage ofmsal.oauth2cli
.While making these changes, I observed the async
AuthorizationCodeCredential.get_token
accepts two optional keyword arguments but doesn't use them correctly, provoking exceptions when either is passed. This has been the case since I added the credential in 1.0.0b4. Whoops 😇. This PR removes them because they have never worked and theAadClient
changes make them obsolete.