Skip to content

Implement authorization code flow#7379

Merged
chlowell merged 14 commits intoAzure:masterfrom
chlowell:auth-code
Sep 30, 2019
Merged

Implement authorization code flow#7379
chlowell merged 14 commits intoAzure:masterfrom
chlowell:auth-code

Conversation

@chlowell
Copy link
Member

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 requests session. I plan to refactor other credentials to use the new wrapper so I can stop maintaining a redundant OAuth client.

Closes #7235

@chlowell chlowell added Client This issue points to a problem in the data-plane of the library. Azure.Identity labels Sep 20, 2019
@chlowell chlowell requested a review from bryevdv September 20, 2019 17:18
@chlowell chlowell requested a review from schaabs as a code owner September 20, 2019 17:18
@chlowell chlowell self-assigned this Sep 20, 2019
@adxsdk6
Copy link

adxsdk6 commented Sep 20, 2019

Can one of the admins verify this patch?

@bryevdv
Copy link
Contributor

bryevdv commented Sep 26, 2019

Modulo my relative ignorance of the detail of MSAL, LGTM

@chlowell chlowell merged commit 0a39aa3 into Azure:master Sep 30, 2019
@chlowell chlowell deleted the auth-code branch September 30, 2019 23:42
YijunXieMS pushed a commit to YijunXieMS/azure-sdk-for-python that referenced this pull request Oct 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Azure.Identity Client This issue points to a problem in the data-plane of the library.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement authorization code flow

3 participants