无法使用O365 API的刷新令牌生成访问令牌 [英] Failure to generate access token using refresh token for O365 API

查看:89
本文介绍了无法使用O365 API的刷新令牌生成访问令牌的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用刷新令牌生成访问令牌时出现invalid_grant错误

I'm getting invalid_grant error while generating access token using refresh token

POST https://login.microsoftonline.com/common/oauth2/v2.0/token

响应

{
  "error": "invalid_grant",
  "error_description":
    "AADSTS50173: The provided grant has expired due to it being revoked. The user might have changed or reset their password. The grant was issued on '2018-06-13T23:20:02.9860000Z' and the TokensValidFrom date for this user is '2018-06-15T17:21:11.0000000Z'\r\nTrace ID: 4237d0b8-51fe-43c2-9b5c-ca9148175400\r\nCorrelation ID: d192091b-6277-4ef9-859a-87ba7f87491a\r\nTimestamp: 2018-06-18 07:22:59Z",
  "error_codes": [50173],
  "timestamp": "2018-06-18 07:22:59Z",
  "trace_id": "4237d0b8-51fe-43c2-9b5c-ca9148175400",
  "correlation_id": "d192091b-6277-4ef9-859a-87ba7f87491a"
}

要求用户更改密码,并且密码已更改.即使更改了密码也看到此错误.在这种情况下,刷新令牌会失效吗?

The user was asked to change password and the password was changed. Seeing this error even after the password is changed. Will the refresh token become invalid in this case?

推荐答案

如果在使用 azure-cli 时遇到此错误,则可以通过以下方式解决:

If you get this error while using the azure-cli You can fix by:

az account clear

az login

发生这种情况是因为更改密码后,基于自己的密码的令牌将失效.然后,您需要清除帐户以再次登录.

That happened because after you change your password, tokens that are based own passwords will be expiry. Then you need to clear your account to login again.

更多信息此处

这篇关于无法使用O365 API的刷新令牌生成访问令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆