【发布时间】:2015-03-09 10:10:34
【问题描述】:
我目前正在尝试开发一个从 Office365 同步日历的 Web 应用程序,到目前为止,我设法从 Azure 的 OAuth 系统获取了几个令牌。
但是,即使刷新令牌似乎至少有 14 天的有效期,似乎每当我尝试刷新我的访问令牌时,我总是会收到以下错误:
OAuth error: "AADSTS70000: Authentication failed. Refresh Token is not valid.
Trace ID: 47836649-e160-40f0-93d1-f599caf4f665
Correlation ID: 45714317-5a29-4242-a785-be23269acf19
Timestamp: 2015-03-09 09:53:18Z"
有什么想法吗?谢谢
-- 编辑--
这是刷新令牌的请求;
//parameters
refresh_token={refresh_token}
&grant_type=refresh_token
&client_id={client_id}
&client_secret={client_secret}
&resource=https%3A%2F%2Foutlook.office365.com
// url
https://login.windows.net/common/oauth2/token
-- 编辑 2--
这是我收到的确切 json 响应;
{
"error":"invalid_grant",
"error_description":"AADSTS70000: Authentication failed. Refresh Token is not valid.\r\nTrace ID: f0b5bc67-9ad5-4a75-b384-393486b31074\r\nCorrelation ID: 05af63f5-989a-4397-924f-58745c9bc964\r\nTimestamp: 2015-03-09 12:21:08Z","error_codes":[70000],
"timestamp":"2015-03-09 12:21:08Z",
"trace_id":"f0b5bc67-9ad5-4a75-b384-393486b31074",
"correlation_id":"05af63f5-989a-4397-924f-58745c9bc964",
"submit_url":null,
"context":null
}
如http://blogs.msdn.com/b/exchangedev/archive/2014/03/25/using-oauth2-to-access-calendar-contact-and-mail-api-in-exchange-online-in-office-365.aspx所述,表示我的刷新令牌已经过时了……但我只是通过全授权机制生成的,这是我无法理解的!
【问题讨论】:
标签: php api oauth-2.0 office365