从Office365进行GoDaddy重定向不返回刷新令牌 [英] GoDaddy redirect from office365 not returning refresh token
问题描述
我有一个可以同步到OneDrive的应用程序.如果用户通过GoDaddy使用Office365并且我的Grant_type为'refresh_token',则它不会返回refresh_token,这反过来又不会让我刷新当前拥有的令牌.我尝试在执行POST请求时添加access_type="offline"
和prompt="consent"
无济于事.帮助吗?
I have an app which syncs to OneDrive. If the user is using Office365 via GoDaddy and I have a grant_type of 'refresh_token', it doesn't return the refresh_token back, which in turn, won't let me refresh the token I currently have. I've tried adding access_type="offline"
and prompt="consent"
when doing a POST request to no avail. Help?
这是我的代码:
credentials = OpenStruct.new
params = {
client_id: client_credentials[:key],
redirect_uri: redirect_url,
client_secret: client_credentials[:secret],
refresh_token: refresh_token,
grant_type: 'refresh_token',
resource: resource_id,
access_type: 'offline',
prompt: 'consent'
}
RestClient.post(client.token_url, params) # doesn't return refresh_token
推荐答案
根据请求,您似乎正在刷新令牌.根据OAuth 2.0代码授予流程,没有关于 access_type 和提示的参数.您可以在下面参考support参数:
Based on the request, it seems you were refresh the token. Based on the OAuth 2.0 code grant flow, there is no parameter about access_type and prompt. You can refer below for the support parameter:
以下是供您参考的帖子:
And here is the post for your reference:
POST /{tenant}/oauth2/token HTTP/1.1
Host: https://login.microsoftonline.com
Content-Type: application/x-www-form-urlencoded
client_id=6731de76-14a6-49ae-97bc-6eba6914391e
&refresh_token=OAAABAAAAiL9Kn2Z27UubvWFPbm0gLWQJVzCTE9UkP3pSx1aXxUjq...
&grant_type=refresh_token
&resource=https%3A%2F%2Fservice.contoso.com%2F
&client_secret=JqQX2PNo9bpM0uEihUPzyrh
这篇关于从Office365进行GoDaddy重定向不返回刷新令牌的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!