Skip to content

refresh token fix for DelegatedTokenCredentials & UserTokenCredentials#632

Merged
jianghaolu merged 2 commits intoAzure:masterfrom
jianghaolu:delegatefix
Sep 12, 2019
Merged

refresh token fix for DelegatedTokenCredentials & UserTokenCredentials#632
jianghaolu merged 2 commits intoAzure:masterfrom
jianghaolu:delegatefix

Conversation

@jianghaolu
Copy link
Copy Markdown
Contributor

@jianghaolu jianghaolu commented Sep 12, 2019

@ViktorFefilov
resolves #625

ViktorFefilovF5 and others added 2 commits September 12, 2019 11:17
- current implementation is using RefreshTokenClient for refresh token but RefreshTokenClient doesnt use client_secret
- changed to using AuthenticationContext as in acquireNewAccessToken

bug flow:
- get authorization_code
- initialize DelegatedTokenCredentials with authorization_code
- do request to resource A with DelegatedTokenCredentials (OK)
- do request to resource B with DelegatedTokenCredentials (fail with message OAuth2 Authorization code was already redeemed)

But actually bug is not about authorization_code. First exception occurs in RefreshTokenClient in method refreshToken but he just returns null in catch block and by this reason DelegatedTokenCredentials is trying to use authorization_code to acquire access token
@jianghaolu jianghaolu changed the title fix for DelegatedTokenCredentials & UserTokenCredentials refresh token fix for DelegatedTokenCredentials & UserTokenCredentials Sep 12, 2019
@jianghaolu jianghaolu merged commit 8090389 into Azure:master Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RefreshTokenClient doesnt use client_secret and that causes error in DelegatedTokenClient

2 participants