Token refresh fails with invalid_client error

Ben

I have a refresh token issued by app A. This refresh token is stored in an Azure Key Vault, to which app B has access. App B now takes this refreh token and exchanges it for an access token.

Unfortunately this exchange fails with the message

"error": "invalid_client",
"error_description": "AADSTS7000215: Invalid client secret is provided."

The client secret is correct though. I was able to acquire an access token to the Key Vault with it.

This is the HTTP request for the refresh token exchange taken from Fiddler (I have removed all secrets and ids):

POST https://login.microsoftonline.com/{TenantId}/oauth2/token HTTP/1.1
Content-Type: application/x-www-form-urlencoded
User-Agent: Mozilla/5.0 (Windows NT; Windows NT 10.0; en-US)  WindowsPowerShell/5.1.17763.134
Host: login.microsoftonline.com
Content-Length: 1221
Connection: Keep-Alive

grant_type=refresh_token
&client_id={ClientId}
&client_secret={ClientSecret}
&resource=https%3A%2F%2Fvault.azure.net
&redirect_uri=https%3A%2F%2Flocalhost%2F
&refresh_token={RefreshToken}

What is going here?

PS: I know it's wild storing a refresh token in a Key Vault, but that's Microsofts recommended way of accessing the CSP Partner API.

SunnySun

Same as the Rohit said, the resource should be the app that you want to access. For the details about this, you could refer to here.

この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。

侵害の場合は、連絡してください[email protected]

編集
0

コメントを追加

0

関連記事

分類Dev

Refresh OAuth token with jersey 2 client

分類Dev

AWS Cognito with OpenID failing with .NET Core gives error of *Error redeeming code: invalid_client*

分類Dev

Syntax error: invalid arithmetic operator (error token is ".")

分類Dev

CAS protocol - refresh token?

分類Dev

Page fails to refresh

分類Dev

Rails link_to destroy method fails due to invalid authenticity token

分類Dev

OpenIddict - Refresh token flow causes entity error when using custom key

分類Dev

Using ADFS OAuth Refresh Token

分類Dev

okhttpリクエストを送信する場合:HTTP ERROR405およびinvalid_client

分類Dev

トークンを更新しようとしたときにSpotifyWeb Apiから{"error": "invalid_client"}

分類Dev

oauth2Client.getTokenにrefresh_tokenがありません

分類Dev

IdentityServer3 PostMan invalid_client

分類Dev

Circumstances of the "invalid_grant" error when refreshing an access token?

分類Dev

Angular 4.3 - HTTP Interceptor - refresh JWT token

分類Dev

iOS Facebook Login Access Token refresh

分類Dev

Identity Server 4 Refresh Token Expiration Not Working

分類Dev

Is stealing a cookie any different to stealing a refresh token?

分類Dev

Google API Refresh Token Security Vulnerability

分類Dev

Generate Refresh token for Google Analytic using JavaScript

分類Dev

Get Access Token from Refresh Token using cURL

分類Dev

Laravel 5.3:パスポートの実装-{"error": "invalid_client"、 "message": "クライアント認証に失敗しました"}

分類Dev

Google Oauth2: Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }'

分類Dev

Bearer error = "invalid_token"、error_description = "発行者が無効です"

分類Dev

"npm run build" fails with SyntaxError:Unexpected token

分類Dev

Moxtra authorization to generate access_token fails

分類Dev

unexpected token error in jquery

分類Dev

SCP fails without error

分類Dev

Token Parsing Error: Lexical error

分類Dev

Appleでサインイン= invalid_client

Related 関連記事

  1. 1

    Refresh OAuth token with jersey 2 client

  2. 2

    AWS Cognito with OpenID failing with .NET Core gives error of *Error redeeming code: invalid_client*

  3. 3

    Syntax error: invalid arithmetic operator (error token is ".")

  4. 4

    CAS protocol - refresh token?

  5. 5

    Page fails to refresh

  6. 6

    Rails link_to destroy method fails due to invalid authenticity token

  7. 7

    OpenIddict - Refresh token flow causes entity error when using custom key

  8. 8

    Using ADFS OAuth Refresh Token

  9. 9

    okhttpリクエストを送信する場合:HTTP ERROR405およびinvalid_client

  10. 10

    トークンを更新しようとしたときにSpotifyWeb Apiから{"error": "invalid_client"}

  11. 11

    oauth2Client.getTokenにrefresh_tokenがありません

  12. 12

    IdentityServer3 PostMan invalid_client

  13. 13

    Circumstances of the "invalid_grant" error when refreshing an access token?

  14. 14

    Angular 4.3 - HTTP Interceptor - refresh JWT token

  15. 15

    iOS Facebook Login Access Token refresh

  16. 16

    Identity Server 4 Refresh Token Expiration Not Working

  17. 17

    Is stealing a cookie any different to stealing a refresh token?

  18. 18

    Google API Refresh Token Security Vulnerability

  19. 19

    Generate Refresh token for Google Analytic using JavaScript

  20. 20

    Get Access Token from Refresh Token using cURL

  21. 21

    Laravel 5.3:パスポートの実装-{"error": "invalid_client"、 "message": "クライアント認証に失敗しました"}

  22. 22

    Google Oauth2: Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }'

  23. 23

    Bearer error = "invalid_token"、error_description = "発行者が無効です"

  24. 24

    "npm run build" fails with SyntaxError:Unexpected token

  25. 25

    Moxtra authorization to generate access_token fails

  26. 26

    unexpected token error in jquery

  27. 27

    SCP fails without error

  28. 28

    Token Parsing Error: Lexical error

  29. 29

    Appleでサインイン= invalid_client

ホットタグ

アーカイブ