dimanche 26 mars 2023

How to use refresh token functionality in lcobucci/jwt using laravel 5?

Unable to implement refresh token code

currently im generating token using this vendor in-build functions. Already implemented the create token functionality, but every token has a expiry time once the token reaches its expiry time i needs to use refresh functionality to regenerate new token. dont know to to implement it.

Here's my existing code for create token,

Authcontroller.php
$token = $user->createToken($request->CLIENT_ID, 
                $scope_data_array
                )->accessToken;

HasApiTokens.php (Laravel/passport inbuilt function)
public function createToken($name, array $scopes = [])
    {
        log::debug("--inside createToken");
        return Container::getInstance()->make(PersonalAccessTokenFactory::class)->make(
            $this->getKey(), $name, $scopes
        );
    }


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/E2AwD1k
via IFTTT

Aucun commentaire:

Enregistrer un commentaire