jwt-auth
jwt-auth copied to clipboard
refresh token flow
How to implement refresh token like this:
- when login return
access_tokenandrefresh_token - when
access_tokenexpires, return a message that informs the token was expired. - after expired, request a new token by sending
refresh_token - then return new
access_tokenwith newrefresh_tokentoo.
I'm using lumen 8 and from your documentation, the AuthController only return access_token
how to generate refresh_token with TTL_REFRESH ?
same questions......
same ....
Same)
i think its similar with oauth2
same :(
Same here
Any solution to this?
How to implement refresh token like this:
- when login return
access_tokenandrefresh_token- when
access_tokenexpires, return a message that informs the token was expired.- after expired, request a new token by sending
refresh_token- then return new
access_tokenwith newrefresh_tokentoo.I'm using lumen 8 and from your documentation, the AuthController only return
access_tokenhow to generaterefresh_tokenwithTTL_REFRESH?
I think you can't implement a refresh token like that, but like this:
- When login return
access_token - When
access_tokenexpires, return a message that informs the token was expired. - After expiration, request a new token by sending the previous
access_tokentoauth()->refresh(true, true). - Then return the new
access_tokenand the previousaccess_tokenhas been blacklisted.
How to implement refresh token like this:
- when login return
access_tokenandrefresh_token- when
access_tokenexpires, return a message that informs the token was expired.- after expired, request a new token by sending
refresh_token- then return new
access_tokenwith newrefresh_tokentoo.I'm using lumen 8 and from your documentation, the AuthController only return
access_tokenhow to generaterefresh_tokenwithTTL_REFRESH?
Actually, i also had same issue. have you already found the solution ?
@okyaneka I stopped using this package because I didn't find a way to achieve the above, so I used Laravel passport to make it.
The tymondesigns/jwt-auth access token has an hybrid behavior. It can be used as a refresh token and as an access token. Once it has passed the expiration time in minutes, It will be invalid as an access token but it will still be valid as a refresh token. When the token is refreshed, the token sent is invalidated (means you cannot use it anymore) and a new token is returned.
Endpoint which has a refresh behavoir should not be using the middleware 'auth:api'. Example:
$this->middleware('auth:api')->except(['refresh']);
or do not include it in a group route middleware.