目前,我让用户通过在Web视图中向以下URL发送请求来登录Microsoft Live:
https://login.live.com/oauth20_authorize.srf?client_id=[CLIENT ID]&scope=[SCOPES]&response_type=token&redirect_uri=[REDIRECT URI]&display=popup
Run Code Online (Sandbox Code Playgroud)
这完美地工作,我收到并保存access_token和authentication_token.请注意refresh_token,即使我包含wl.offline_access范围,它也不会返回a .
访问令牌过期并需要刷新时会出现此问题.我正在尝试使用Microsoft文档中的方法刷新令牌:
https://login.live.com/oauth20_token.srf?client_id=[CLIENT ID]&redirect_uri=[REDIRECT URI]&client_secret=[CLIENT SECRET]&refresh_token=[WHAT TO PUT HERE?]&grant_type=refresh_token
Run Code Online (Sandbox Code Playgroud)
但是,a refresh_token在登录时从未返回,所以我不确定要传入什么.请注意,发送authentication_token(它应该用于什么?)作为refresh_token参数会导致以下结果:
{
"error": "invalid_grant",
"error_description": "The provided value for the input parameter 'refresh_token' is not valid."
}
Run Code Online (Sandbox Code Playgroud)
有谁知道如何通过REST API正确刷新Microsoft Live令牌?