Implement authorization code flow#7379
Merged
chlowell merged 14 commits intoAzure:masterfrom Sep 30, 2019
Merged
Conversation
|
Can one of the admins verify this patch? |
bryevdv
reviewed
Sep 23, 2019
bryevdv
approved these changes
Sep 26, 2019
Contributor
|
Modulo my relative ignorance of the detail of MSAL, LGTM |
YijunXieMS
pushed a commit
to YijunXieMS/azure-sdk-for-python
that referenced
this pull request
Oct 9, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implementing the authorization code flow with
AuthorizationCodeCredential, a credential that redeems a previously acquired authorization code for an access token. Authorization codes are single-use but AAD typically provides a refresh token when one is redeemed, so when an access token expires the credential redeems the refresh token for a new one.Rather than further extend the just-enough-features OAuth client used by other credentials, I've added a thin wrapper around MSAL's OAuth client. Wrapping MSAL's OAuth client is easier than wrapping its applications because a client instance holds and consistently uses an easily-patched
requestssession. I plan to refactor other credentials to use the new wrapper so I can stop maintaining a redundant OAuth client.Closes #7235