【发布时间】:2017-05-14 22:01:27
【问题描述】:
我已经按照文档安装了 Laravel Passport,并且我修改了所有需要的代码区域。
我正在设置密码授予令牌,以便用户在使用网站的用户名和密码登录时能够获得 API 令牌。不过,当涉及到 grant_type 时,我遇到了一个问题。 出于某种原因,Laravel 抱怨授权类型无效。
{
"error": "unsupported_grant_type",
"message": "The authorization grant type is not supported by the authorization server.",
"hint": "Check the `grant_type` parameter"
}
这些是我发布到/oauth/token的字段
client_id = 4
client_secret = SMiYE7XqDNtXKQnmkYmFnXxfAaV83vRhnJ9zwCtZ
username = jcrawford@domain.com
password = **************
grant_type = password
scope = *
我已经运行php artisan passport:install,我也尝试运行php artisan passport:client --password
两个命令都有效,并且都创建了客户端和机密,但是,我似乎无法克服有关 grant_type 的错误。
有什么建议可以解决这个问题,以便密码授予令牌对我有用?
【问题讨论】:
标签: laravel-5.3 laravel-passport