【问题标题】:Not receive refresh_token from OAuth 2 Server Laravel未从 OAuth2 服务器 Laravel 接收刷新令牌
【发布时间】:2015-08-13 22:02:34
【问题描述】:

我目前正在使用来自 here 的 OAuth 2 Server Laravel

我同时使用client_credentialsrefresh_token 作为grant_types

'grant_types' => array(

        'client_credentials' => array(
            'class'                 => 'League\OAuth2\Server\Grant\ClientCredentials',
            'access_token_ttl'      => 60,
        ),

        'refresh_token' => array(
            'class'                 => 'League\OAuth2\Server\Grant\RefreshToken',
            'access_token_ttl'      => 3600,
            'refresh_token_ttl'     => 604800,
            'rotate_refresh_tokens' => false,
        ),
    ),

当我从 AuthorizationServer 请求令牌时,我只收到此响应:

{
    "access_token": "0JpNT0vORf4HC2fTfvkssjS3SEPhfai2YRTgELIC",
    "token_type": "bearer",
    "expires": 1395127143,
    "expires_in": 60
}

如您所见,没有refresh_token 回复,只有access_token。如何解决这个问题?如何获取refresh_token

【问题讨论】:

    标签: php oauth laravel laravel-4 oauth-2.0


    【解决方案1】:

    据我了解,客户端凭据授权无法返回刷新令牌,请参阅规范的 section 4.4.3,其中讨论了此特定授权的响应。

    如果您需要刷新令牌,则需要使用不同的授权类型。

    【讨论】:

      【解决方案2】:

      rotate_refresh_tokens设置为true

      【讨论】:

        【解决方案3】:

        注意:刷新令牌授权将与以下授权之一一起使用:PasswordGrantAuthCodeGrant

        【讨论】:

          猜你喜欢
          • 2018-10-17
          • 2020-01-16
          • 2017-04-20
          • 1970-01-01
          • 2017-12-13
          • 2012-07-21
          • 2021-08-26
          • 2017-05-29
          • 2022-11-09
          相关资源
          最近更新 更多