Category : laravel-passport

I want to using a package in my project. Composer.json: "require": { "php": "^7.2.5|^8.0", "fideloper/proxy": "^4.4", "fruitcake/laravel-cors": "^2.0", "guzzlehttp/guzzle": "^6.3.1|^7.0.1", "hekmatinasser/verta": "^1.11", "laravel/framework": "^7.29", "laravel/passport": "^9.3", "laravel/tinker": "^2.5", "lcobucci/jwt": "3.3.3", "pishran/zarinpal": "^2.2" }, My target package to install : composer require ipecompany/smsirlaravel Problem : When I try this on composer, I see follwing error Problem ..

Read more

It’s my first time trying out this package and I followed the installation guide at https://laravel.com/docs/8.x/passport but when this code block in my controller signup action it throws the error: $token = $user->createToken(‘authToken’)->accessToken; Here’s the code for my signup action: public function signup(Request $request){ $request->validate([ ‘name’ => ‘required’, ’email’ => ‘required|string|email:rfc,dns|unique:users’, ‘password’ => ‘required|string|confirmed’ ]); ..

Read more

While updating from Laravel 5.5 to 5.6, I updated my Passport as well, but upon composer install the following error pops up: In AppServiceProvider.php line 42: Call to undefined method LaravelPassportPassport::useClientUUIds() This is my AppServiceProvider register method: public function register() { Passport::useClientUUIds(); Passport::ignoreMigrations(); } What is the alternative to this method in the updated version? ..

Read more

I am using laravel/passport for api authentication Today My old access token isn’t working and When i try to generate new access token then i got Implicit conversion of keys from strings is deprecated. Please use InMemory or LocalFileReference classes. {"exception":"[object] (ErrorException(code: 0): Implicit conversion of keys from strings is deprecated. Please use InMemory or ..

Read more

I’m trying to utilize laravel passport for api authentication $user = User::create([ ‘first_name’ => $request->firstName, ‘last_name’ => $request->lastName, ’email’ => $request->email, ‘password’ => Hash::make($request->password), ‘verified’ => User::UNVERIFIED_USER, ‘capacity’ => User::REGULAR, ‘verification_token’ => User::generateVerificationToken(), ]); $token = $user->createToken(‘Laravel Password Grant Client’)->accessToken; return response()->json([‘data’ => $token]); and I’m getting this error: "message": "Method LaravelPassportBridgeAccessToken::__toString() must not throw ..

Read more

I’m using laravel/passport:7.5.1 package in my laravel project and recently faced with this exception. Any Idea? I temperory downgrade the lcobucci/jwt:3.4.0 package to lcobucci/jwt:3.3.3 Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated. Stack Trace: "exception": { "trace": [ "/var/www/app/vendor/lcobucci/jwt/src/Builder.php:334", "/var/www/app/vendor/lcobucci/jwt/src/Builder.php:185", "/var/www/app/vendor/lcobucci/jwt/src/Builder.php:201", "/var/www/app/vendor/league/oauth2-server/src/Entities/Traits/AccessTokenTrait.php:34", ..

Read more

I’m using laravel/passport:7.5.1 package in my laravel project and recently faced with this exception. Any Idea? Replicating claims as headers is deprecated and will removed from v4.0. Please manually set the header if you need it replicated.4 Stack Trace: "exception": { "trace": [ "/var/www/app/vendor/lcobucci/jwt/src/Builder.php:334", "/var/www/app/vendor/lcobucci/jwt/src/Builder.php:185", "/var/www/app/vendor/lcobucci/jwt/src/Builder.php:201", "/var/www/app/vendor/league/oauth2-server/src/Entities/Traits/AccessTokenTrait.php:34", "/var/www/app/vendor/league/oauth2-server/src/ResponseTypes/BearerTokenResponse.php:28", "/var/www/app/vendor/league/oauth2-server/src/AuthorizationServer.php:202", "/var/www/app/vendor/laravel/passport/src/PersonalAccessTokenFactory.php:114", "/var/www/app/vendor/laravel/passport/src/PersonalAccessTokenFactory.php:71", "/var/www/app/vendor/laravel/passport/src/HasApiTokens.php:67", "/var/www/app/app/Http/Controllers/Auth/Shop/GetTokenController.php:84", "/var/www/app/vendor/laravel/framework/src/Illuminate/Routing/Controller.php:54", "/var/www/app/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php:45", ..

Read more

Authenticate web using Laravel Passport I’m Redirecting the Response by specifying the access token as a Bearer token in the Authorization header to the route. And getting below error. IlluminateAuthAuthenticationException: Unauthenticated. File: Controller.php $id = ‘1’; $accessToken = ‘passport_token_value’; return redirect(‘home/id=’.$id)->header(‘Authorization’, ‘Bearer ‘.$accessToken); I have assigned Laravel Passport custom middleware to protect and authenticate different ..

Read more

i’m building an API for a single page application (spa) that is completely separated (different domain) what is the best approach for authentication ? passport,sanctum? Passport is a good choice but its kinda complicated i can’t understand it and i don’t need the oauth feature .. i just want an access token and maybe a ..

Read more

I am working in two apps: accounts.domain.com (Laravel app) and dash.domain.com (Not laravel, but php). I want dash users to login through accounts to use the app, so I figured I could use OAuth to achieve this. I installed Laravel Passport and everything worked fine when getting an authorization code: $query = http_build_query([ ‘client_id’ => ..

Read more

There are a lot of versions of this question floating around, but i haven’t found any that deal with these specific packages. I am trying to install laravel passport version 10 into my laravel 8 installation, When running composer require laravel/passport i get the following response: Your requirements could not be resolved to an installable ..

Read more

I have a website built upon Laravel and Vuejs, which uses passport access token for authentication. Also we have android application which uses the same way ‘access token’ for authentication. The next part is out of my knowledge where we are authenticating the user in app via Api and issuing access token but want to ..

Read more

[enter image description here][1] [1]: https://i.stack.imgur.com/90M0R.png*** when i query api / user test path returns the user data without any problem,but when I create a post route inside a controller that I want to return as well user $ request-> user () always gets me a 404 error. Route : Route::post(‘valid’, ‘[email protected]’)->middleware(‘auth:api’); Controller public function ..

Read more

i’m trying to setup vue.js login page (front-end) with Laravel 8 (back-end) using Passport and GuzzleHttp. oAuth/Token: works correctly (tested with Insomnia) userData: works correctly (tested with Insomnia) Testing Domain is setup by local virutal host (XAMPP). My controller looks like: <?php namespace AppHttpControllers; use IlluminateHttpRequest; class AuthController extends Controller { public function login (Request ..

Read more