Please include the following information in your post:
Which SDK this is regarding: e.g. auth0-node
auth0/laravel-auth0
SDK Version: e.g. 2.29.0
6.5
Platform Version: e.g. Node 12.19.0
PHP8.1
Currently, as far as I can see, its impossible using the laravel-auth0 library to renew tokens.
Primary question
How do I issue a renew token request via laravel-auth0?
Notes:
I can access the refresh token
I have offline_access as a scope, and its enabled in the API
I can login/register
I can access the access token and correctly validate it
I’ve gone through all the source code, line by line, trying to figure this out.
The only way I can do it is by modifying the source (obviously not a solution).
In vendor/auth0/login/src/Auth0/Login/Auth0Service.php
If I add the following function, it works.
public function renewTokens()
{
return $this->getSDK()->renewTokens();
}
The alternative would be to construct a new SDK (new Auth0($config)), but I feel like a) that is a lot of duplicated code and is b) fragile making sure the two are in sync.
I also am not confident that would work as the whole provider is wrapped in a singleton, so creating a second seems to break that abstraction.
This was answered via the issue tracker.
In short, no, its not exposed in v6.5 There doesn’t appear to be a clear way in a stateful laravel app to renew tokens and we should wait until v7 is available