401 Unauthorized – 在Doorkeeper中请求刷新令牌时授予无效

我在请求刷新令牌方面遇到了麻烦,它一直在返回未经授权的401错误。 我不知道在我提出请求时是否缺少参数。

我添加了刷新令牌的门卫配置。

use_refresh_token

这是请求详细信息:

{{root_url}}/oauth/token

 {"refresh_token"=>"034a74c085219fb8297fd8ef9b59f080918f" "format"=>:json, "controller"=>"/oauth/tokens", "action"=>"create", "grant_type"=>"refresh_token", "client_id"=>"", "client_secret"=> ""} 

错误说明:

 {:error=>:invalid_grant, :error_description=> "The provided authorization grant is invalid, expired, revoked, does not match the redirection URI used in the authorization request, or was issued to another client."} 

顺便说一句,我的所有api请求身份validation都没有让这个刷新令牌失败。 我想知道我在请求参数中缺少什么。

不要传递client_id和client_secret。

刷新令牌所需的参数是:

  • grant_type
  • refresh_token

可选参数:

  • 范围。

请参阅rfc6749的“ 刷新令牌”部分:OAuth 2.0授权框架