我已经被困在Laravel护照问题上4天了。以下是我验证登录凭据的代码库,从而验证用户登录(基于令牌)
我已经完成了护照整合的所有步骤。
我调用的API(来自邮递员):
http://localhost/oauth/token/?email=admin@test.com
即
email:admin@test.com
password:Abcd@123
grant_type:password
client_id:3
client_secret:xqVaBsdfsdfsf42fso45GfYAgUKeR2OjK
scope:*
config/auth。php
'defaults' => [
'guard' => 'api',
'passwords' => 'users',
],
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'passport',
'provider' => 'users',
],
],
但是我得到了错误:
{
"error": "unsupported_grant_type",
"message": "The authorization grant type is not supported by the authorization server.",
"hint": "Check the `grant_type` parameter"
}
我收到的错误
[2017-03-08 12:12:10] local.ERROR: League\OAuth2\Server\Exception\OAuthServerException: The authorization grant type is not supported by the authorization server. in /var/www/html/test/testProj/Proj_Latest/vendor/league/oauth2-server/src/Exception/OAuthServerException.php:65
Stack trace:
#0 /var/www/html/test/testProj/Proj_Latest/vendor/league/oauth2-server/src/AuthorizationServer.php(204): League\OAuth2\Server\Exception\OAuthServerException::unsupportedGrantType()
#1 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/passport/src/Http/Controllers/AccessTokenController.php(63): League\OAuth2\Server\AuthorizationServer->respondToAccessTokenRequest(Object(Zend\Diactoros\ServerRequest), Object(Zend\Diactoros\Response))
#2 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/passport/src/Http/Controllers/HandlesOAuthErrors.php(25): Laravel\Passport\Http\Controllers\AccessTokenController->Laravel\Passport\Http\Controllers\{closure}()
#3 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/passport/src/Http/Controllers/AccessTokenController.php(64): Laravel\Passport\Http\Controllers\AccessTokenController->withErrorHandling(Object(Closure))
#4 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(47): Laravel\Passport\Http\Controllers\AccessTokenController->issueToken(Object(Zend\Diactoros\ServerRequest))
#5 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Route.php(203): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(Laravel\Passport\Http\Controllers\AccessTokenController), 'issueToken')
#6 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Route.php(160): Illuminate\Routing\Route->runController()
#7 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Router.php(559): Illuminate\Routing\Route->run()
#8 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#9 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(49): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#10 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure))
#11 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#12 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#13 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Router.php(561): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#14 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Router.php(520): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#15 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Router.php(498): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#16 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(174): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#17 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(30): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#18 /var/www/html/test/testProj/Proj_Latest/app/Http/Middleware/ResponseLogger.php(22): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#19 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): App\Http\Middleware\ResponseLogger->handle(Object(Illuminate\Http\Request), Object(Closure))
#20 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#21 /var/www/html/test/testProj/Proj_Latest/app/Http/Middleware/RequestLogger.php(45): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#22 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): App\Http\Middleware\RequestLogger->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 /var/www/html/test/testProj/Proj_Latest/app/Http/Middleware/Cors.php(18): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#25 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): App\Http\Middleware\Cors->handle(Object(Illuminate\Http\Request), Object(Closure))
#26 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#27 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#28 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse->handle(Object(Illuminate\Http\Request), Object(Closure))
#29 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#30 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(59): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#31 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Cookie\Middleware\EncryptCookies->handle(Object(Illuminate\Http\Request), Object(Closure))
#32 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#33 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#34 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#35 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#36 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(30): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#37 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#38 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#39 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#40 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#41 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#42 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php(46): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#43 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(148): Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php(53): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(102): Illuminate\Routing\Pipeline->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#46 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(149): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#47 /var/www/html/test/testProj/Proj_Latest/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(116): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#48 /var/www/html/test/testProj/Proj_Latest/public/index.php(53): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#49 {main}
现在,由于这不起作用,我尝试了以下方法:
Auth::attempt(array('email' => 'admin@test.com', 'password' => 'Abcd@123'))
但这次我收到了:
[2017-03-08 12:00:00]当地。错误:Symfony\Component\Debug\Exception\fatalthrowable错误:调用/var/www/html/…中未定义的方法illumb\Auth\RequestGuard::trunt()/供应商/laravel/framework/src/illumb/Auth/AuthManager。菲律宾比索:294
在Laravel 5.4中似乎什么都不起作用
首先,确保授权客户端是一个“密码客户端”,其编码与命令类似:
php artisan passport:client --password
这意味着数据库中的password_client列在相应的客户端旁边具有值1。我还在从用户界面创建的默认用户客户端上挣扎了很多,但它不适用于这些客户端。
我遵循这个Ruby Gmail应用编程接口快速入门指南来授权Gmail应用编程接口的用户。我在谷歌控制台创建了一个类型的应用程序,并生成了它的credentials.json文件(并将其放在quickstart.rb旁边)。我已经向应用程序提供了一个,该应用程序在heroku上作为rails应用程序托管。网址的格式如下 https://myapp-api-heroku.com/my_redirec
我正在尝试从c#WPF桌面应用程序向我的WebAPI发送帖子。 不管我做什么 {"错误":"unsupported_grant_type"} 这就是我所尝试的(我已经尝试了我能找到的一切): 此外,开发web api当前正在进行测试:http://studiodev.biz/ 基本超文本传输协议客户端对象: 使用以下发送方法: 失败后,我在谷歌上搜索并尝试: 同样的结果,所以我尝试: 注意:我可以
定义的新集成密钥9xxx7e null 但仍然得到401的回应内容:
我已经设置了谷歌日历API项目。我正在使用OAuth 2.0访问带有同意屏幕的Google日历API数据。 我遵循了这里提到的流程:https://developers.google.com/google-apps/calendar/quickstart/php 当我试图获取授权Google帐户的所有日历时。我收到以下错误: 以下是获取所有日历列表的代码: 有人知道这里发生了什么吗?我如何修复这个
我正在按照有关如何使用Postman从Paypal获取访问令牌的说明进行操作。 我不断收到这个错误信息: “错误”:“不支持的授权类型”,“错误描述”:“授权类型为空” 这是我的邮递员设置: 网址:https://api.sandbox.paypal.com/v1/oauth2/token 授权:用户名:客户端\u id。。。密码:秘密。。。 标题:内容类型- 正文:表单-urlencoded
在Laravel-5.8项目中,从这个控制器: 我航行到: 使用: 当我想导航回: 公共功能manager_employee_goal($id) 我用过: 但我有一个错误: 路径[evaluation.evaluation\u goals.manager\u employee\u goal/{id?}]未定义 以下是我的路线/web.php: 我如何解决它? 谢谢你