【问题标题】:Laravel Passport client_credentialsLaravel Passport client_credentials
【发布时间】:2017-07-29 19:10:45
【问题描述】:

Good Day 有人用这种方法吗? https://laravel.com/docs/5.4/passport#client-credentials-grant-tokens

我尝试制作只有 client_id 和 client_secret 的注册 API,我希望返回作为访问令牌、刷新令牌、过期日期,但返回 www.url.com/oauth/token 是这个

{
    "error": "unsupported_grant_type",
    "message": "The authorization grant type is not supported by the authorization server.",
    "hint": "Check the `grant_type` parameter"
}

任何人都可以帮助我..? 提前致谢

【问题讨论】:

    标签: php laravel oauth-2.0 laravel-passport


    【解决方案1】:

    我知道这是旧的,我不知道你是否可以正常工作。根据您对问题的描述,请求中可能缺少 grant_type 参数。您需要grant_typeclient_idclient_secret。当我省略参数时,我会收到相同的验证错误消息。如果您使用的是客户端凭据授权,如果您使用的是示例中的代码,则需要 'grant_type' => 'client_credentials'

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-08-02
      • 1970-01-01
      • 1970-01-01
      • 2019-04-26
      • 2017-07-29
      • 2020-07-25
      • 2018-05-14
      相关资源
      最近更新 更多