Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Passport laravel createToken Personal access client not found

After setup of passport, I have configured and created a controller to manage Register-Login- and - access to a resource for a general external post request. I do not need for a specific client. But when I try to create a token in the registration or in the login:

$tokenObj=$user->createToken('APPLICATION')->accessToken; 

The error is:

RuntimeException: Personal access client not found. Please create one. in file C:\xampp7.1\htdocs\passport\vendor\laravel\passport\src\ClientRepository.php on line 94 Stack trace: 1. RuntimeException->() C:\xampp7.1\htdocs\passport\vendor\laravel\passport\src\ClientRepository.php:94 2. Laravel\Passport\ClientRepository->personalAccessClient() C:\xampp7.1\htdocs\passport\vendor\laravel\passport\src\PersonalAccessTokenFactory.php:71

How can I solve it?

like image 792
Jonio Avatar asked Mar 14 '19 17:03

Jonio


People also ask

How do I create a personal access client?

Step 1: Create authorization request link. Step 2: Request user for authorization. Step 3: Exchange authorization code with access tokenpost. Step 4: Use access token for REST API requests.

What is laravel personal access client?

Personal Access Clients who has personal access tokens are authorized to access your Resource Server . Personal access tokens are good for giving third party applications access to your API without requiring your user to input their credentials in a potentially untrusted client.

What is oauth2 authentication in laravel?

Laravel Passport is an OAuth 2.0 server implementation for API authentication using Laravel. Since tokens are generally used in API authentication, Laravel Passport provides an easy and secure way to implement token authorization on an OAuth 2.0 server.


1 Answers

for me it solved by running

php artisan passport:install 

because it have been happened after refreshing my database.

like image 86
Ruberandinda Patience Avatar answered Sep 20 '22 15:09

Ruberandinda Patience