laravel-passport

Laravel Passport invalid_credentials on register

点点圈 提交于 2020-01-15 09:28:47
问题 I have a problem with Passport. I have the messages: "error": "invalid_credentials", "message": "The user credentials were incorrect." When I try the register or the login. Yet the user is still stored in database. Here are my codes: AuthServiceProvider : <?php namespace App\Providers; use Laravel\Passport\Passport; use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Carbon\Carbon; class AuthServiceProvider extends

Laravel Passport invalid_credentials on register

≯℡__Kan透↙ 提交于 2020-01-15 09:28:00
问题 I have a problem with Passport. I have the messages: "error": "invalid_credentials", "message": "The user credentials were incorrect." When I try the register or the login. Yet the user is still stored in database. Here are my codes: AuthServiceProvider : <?php namespace App\Providers; use Laravel\Passport\Passport; use Illuminate\Support\Facades\Gate; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Carbon\Carbon; class AuthServiceProvider extends

Laravel 5.3 Passport Custom Grants?

老子叫甜甜 提交于 2020-01-13 07:37:12
问题 I know I am not the only person who has come up to this point. Does anyone know how to properly implement a custom grant in Laravel(5.3) Passport? Or Have a good link/tutorial to reference how to properly do it? I know there's this package: https://github.com/mikemclin/passport-custom-request-grant But I'm asking for a more "Do it yourself" approach. Thank you in advance. 回答1: namespace App\Providers; use App\Auth\Grants\FacebookGrant; use Illuminate\Foundation\Support\Providers

Get a 401 error with POST and PUT Laravel passport/Vue/Axios

冷暖自知 提交于 2020-01-06 12:29:29
问题 I am working on a Vue application with a seperate Laravel back-end API. The back-end has Laravel passport that requires an access token when doing database calls. Normally everything goes right, I can get data back from the database but for some reason, 2 of my calls gets errors, the POST en PUT. I don't know why I get unauthenticated (401) from laravel passport back, while my get request is going well. Also, both POST and PUT are going fine in the postman application. The get request

Get a 401 error with POST and PUT Laravel passport/Vue/Axios

醉酒当歌 提交于 2020-01-06 12:27:28
问题 I am working on a Vue application with a seperate Laravel back-end API. The back-end has Laravel passport that requires an access token when doing database calls. Normally everything goes right, I can get data back from the database but for some reason, 2 of my calls gets errors, the POST en PUT. I don't know why I get unauthenticated (401) from laravel passport back, while my get request is going well. Also, both POST and PUT are going fine in the postman application. The get request

Lumen Class Route Not found

扶醉桌前 提交于 2020-01-05 06:27:52
问题 I am trying to implement the code stated in Laracast. $proxy = Request::create( '/oauth/token', 'POST' ); return Route::dispatch($proxy); This gives me error Class Route Not found .My question is how can we use Route:dispatch() in lumen ? Thanks 回答1: Lumen 5.4 global $app; $proxy = Request::create( '/oauth/token', 'post', [ 'grant_type'=>$grant_type, 'client_id'=>$client_id, 'client_secret'=>$client_secret, 'username'=>$username, 'password'=>$password ] ); return $app->dispatch($proxy); 回答2:

Laravel combine Passport authentication and normal authentication

左心房为你撑大大i 提交于 2020-01-04 12:44:44
问题 How do I combine Passport authentication and normal laravel authentication? I want the user to be logged in on pages of web-middleware and api-middleware. The login route is in api-middleware. Currently I have set up Passport authentication and it works fine for all api-middleware routes. How to make the user logged in in web-middleware as well? Edit #1 What Im doing: Login code $http = new \GuzzleHttp\Client(); try { $response = $http->post(config('services.passport.login_endpoint'), [ 'form

laravel passport oauth function using curl or guzzle

本小妞迷上赌 提交于 2020-01-03 15:58:21
问题 I have this route in api route file Route::post('/user/register', 'HomeController@register'); and the register function is public function register(Request $request) { $user = User::create([ ... ]); return $this->getAccessToken($request); } public function getAccessToken(Request $request) { $url = url('/oauth/token'); $headers = ['Accept' => 'application/json']; $http = new Client; $response = $http->post($url, [ 'headers' => $headers, 'form_params' => [ 'grant_type' => 'password', 'client_id

MethodNotAllowedException Laravel Password Grant API

女生的网名这么多〃 提交于 2020-01-03 05:25:11
问题 I have recently developed a password grant API to be used by my client application. It is successfully generating access tokens for users after the client has been authorized. The problem I'm facing now is how to pass the access token back from client application to Laravel with each request? (as done by Headers in passport) I have gone through the laravel API Authentication by passport documentation. What I'm trying to do I have already tested the work flow of the API on postman. It was

Laravel Passport: Are API's tokens stored on the server, and where?

不羁的心 提交于 2020-01-03 02:48:27
问题 I tried to find where the token returned by the method $user->createToken('MyApp')->accessToken; is stored on the database but I can't seem to find it. Is it stored in the server in the first place? If so, where? If it's not stored on the server because it's self-contained, why did Laravel's developers put $table->rememberToken(); in the default create_users_table.php migration? What's the purpose of the column remember_token ? Thank you for your help. 回答1: I guess you could say that some