laravel-passport

Laravel Passport invalid_grant for password grant_type

与世无争的帅哥 提交于 2020-07-20 13:34:30
问题 I've been trying to create an access_token for my api. I've followed the setup and am using Postman to test/create a token. I can't seem to get past an invalid_grant error. I've tried what seems like every combination I've been able to find without any luck. Here is my setup: Sending a POST request to: http://mywebsite.local/oauth/token In the body, I am setting form-data to this (name/value): grant_type password client_id 1 client_secret <super_long_string> username my@email.com password

Laravel Passport invalid_grant for password grant_type

喜欢而已 提交于 2020-07-20 13:33:35
问题 I've been trying to create an access_token for my api. I've followed the setup and am using Postman to test/create a token. I can't seem to get past an invalid_grant error. I've tried what seems like every combination I've been able to find without any luck. Here is my setup: Sending a POST request to: http://mywebsite.local/oauth/token In the body, I am setting form-data to this (name/value): grant_type password client_id 1 client_secret <super_long_string> username my@email.com password

Call to undefined method Symfony\Component\HttpFoundation\Response::header()

自闭症网瘾萝莉.ら 提交于 2020-07-04 09:00:28
问题 Hi i was using a cors middleware which seems to work fine until i added Laravel Passport now there is a problem with it.. it shows the error Call to undefined method Symfony\Component\HttpFoundation\Response::header() on line number 36 This is my middleware : <?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Response; class Cors { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public

Call to undefined method Symfony\Component\HttpFoundation\Response::header()

∥☆過路亽.° 提交于 2020-07-04 08:59:46
问题 Hi i was using a cors middleware which seems to work fine until i added Laravel Passport now there is a problem with it.. it shows the error Call to undefined method Symfony\Component\HttpFoundation\Response::header() on line number 36 This is my middleware : <?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Response; class Cors { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public

Call to undefined method Symfony\Component\HttpFoundation\Response::header()

末鹿安然 提交于 2020-07-04 08:58:10
问题 Hi i was using a cors middleware which seems to work fine until i added Laravel Passport now there is a problem with it.. it shows the error Call to undefined method Symfony\Component\HttpFoundation\Response::header() on line number 36 This is my middleware : <?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Response; class Cors { /** * Handle an incoming request. * * @param \Illuminate\Http\Request $request * @param \Closure $next * @return mixed */ public

Laravel Sanctum vs Passport [closed]

萝らか妹 提交于 2020-06-27 06:51:13
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 3 days ago . Improve this question What are the differences between these 2? And which one is better for a simple VueJS app? I've read their documents a few times but still confused. Thank you very much. 回答1: Passport provides a full OAuth2 server implementation for your Laravel

Method Illuminate\Auth\RequestGuard::logout does not exist Laravel Passport

点点圈 提交于 2020-06-22 22:52:09
问题 Am using Laravel Passport to build an API, I removed the web routes and its guard accordingly How can I test user logout? This is what I have so far: Logout Test /** * Assert users can logout * * @return void */ public function test_logout() { // $data->token_type = "Bearer" // $data->access_token = "Long string that is a valid token stripped out for brevety" $response = $this->json('POST', '/api/logout', [], [ 'Authorization' => $data->token_type . ' ' . $data->access_token ]); $response-

Method Illuminate\Auth\RequestGuard::logout does not exist Laravel Passport

流过昼夜 提交于 2020-06-22 22:51:48
问题 Am using Laravel Passport to build an API, I removed the web routes and its guard accordingly How can I test user logout? This is what I have so far: Logout Test /** * Assert users can logout * * @return void */ public function test_logout() { // $data->token_type = "Bearer" // $data->access_token = "Long string that is a valid token stripped out for brevety" $response = $this->json('POST', '/api/logout', [], [ 'Authorization' => $data->token_type . ' ' . $data->access_token ]); $response-

Passport without php artisan passport: install on deploying server

此生再无相见时 提交于 2020-03-19 21:48:51
问题 I have applied the passport auth in laravel. I have done this on my local machine and AWS server too. Now I am trying to apply the same to a shared hosting, where I won't be able to access the terminal. So my curiosity is just to know is it possible to apply for the passport without php artisan passport: install ? 回答1: Try to make a controller with a connected HTTP route, and put Artisan::call('passport:install'); there. Then go to the url to run the command. 回答2: Usually you would use the

Heroku and Laravel Passport

ε祈祈猫儿з 提交于 2020-03-13 06:44:24
问题 I try to install my app on heroku. This app is a php-laravel app with the "passport" for the authentication. All is running fine in my local machine (mac os). When I try to do a simple 'post' with postman, I have this error : 2018-03-17T17:05:22.059708+00:00 app[web.1]: [17-Mar-2018 17:05:22 UTC] [2018-03-17 17:05:22] production.ERROR: Key path "file:///app/storage/oauth-private.key" does not exist or is not readable {"exception":"[object] (LogicException(code: 0): Key path \"file:///app