Laravel 护照不支持授权授予类型?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42642889/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 15:29:34  来源:igfitidea点击:

laravel passport doesnt support authorization grant type?

laraveloauth-2.0laravel-passport

提问by dasersoft

I am having an issue using the authorization grant in laravel/passport. I usually get this error:

我在使用 laravel/passport 中的授权时遇到问题。我通常会收到此错误:

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

{"error":"unsupported_grant_type","message":"授权服务器不支持授权类型。","hint":"检查grant_type参数"}

First of all it takes me to login page, when i login it throws the above error. However the password grant works fine.

首先它需要我登录页面,当我登录时它会抛出上述错误。但是密码授予工作正常。

I created my client using: php artisan passport:client

我使用以下方法创建了我的客户端:php artisan Passport:client

回答by Manuel Temple

try body raw and Content-Type application/json

尝试 body raw 和 Content-Type application/json

Passport consume service

护照消费服务

回答by Juha Vehnia

In order to use grant type "client_credentials" you need to create you client using --client option like below:

为了使用授权类型“client_credentials”,您需要使用 --client 选项创建客户端,如下所示:

php artisan passport:client --client

Take a look at the Laravel documentation here

在此处查看 Laravel 文档