【发布时间】:2021-07-15 05:30:41
【问题描述】:
我正在使用 Azure AD 登录来获取访问令牌,并能够使用其 API REST 向 SharePoint Online 发出请求。
我能够获取此访问令牌,但是当我尝试获取刷新令牌时,出现错误。
此时我正在使用 Postman 进行测试。
我正在做以下事情:
- 我开始调用下一个 URL 来获取代码:
- 收到代码后,我会执行以下 POST:
grant_type:authorization_code
client_id:{client_id}
client_secret:{client_secret}
代码:{code_generated_previous_request}
redirect_uri:https://myapplication.com
资源:https://{mycompany}.sharepoint.com/
- 我收到此回复:
- 最后,我尝试通过以下 POST 刷新令牌:
POST /{租户}/oauth2/token HTTP/1.1
主机:login.microsoftonline.com
用户代理:PostmanRuntime/7.13.0
接受: */*
缓存控制:无缓存
grant_type:refresh_token
client_id:{client_id}
client_secret:{client_secret}
refresh_token:YYYYYYYY...
redirect_uri:https://myapplication.com
- 但是在这一步,我得到一个错误:
我已经检查了 URL 编码,没有 URL 编码,删除了 client_secret 和 redirect_uri 参数和其他东西,但我总是得到同样的错误。当然,我犯了一个愚蠢而明显的错误,但我看不出是哪一个。
【问题讨论】:
标签: azure post login oauth-2.0 azure-active-directory