'How to get refresh token with personal access token in laravel passport
Thanks for help I am working on a project with laravel in backend and react js on the front end
I cannot understand how to issue refresh token along with personal access token
Createtoken('token_name')->accesstoken(); Only issues an access token
Solution 1:[1]
$user->createToken('Token Name')->accessToken; Creates a Personal Access Tokens that can't be refreshed.
You need to issue an OAuth 2.0 authorization code flow for this. See Laravel`s Documentation about how to issue an access token
- First you need to create an app_client using the
passport:clientArtisan command - then you need to raise an authorization request
- approve the request
- with that you have an authorization code and can request an access token
The /oauth/token endpoint will return a JSON response containing access_token and a refresh_token.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | lordisp |
