class CachingTokenProvider implements TokenProviderInterface (View source)

Properties

protected string|null $jwt

The cached token.

protected int $refreshAfter

The Unix timestamp after which the cached token must be re-minted.

Methods

__construct(TokenProviderInterface $provider, int $clockSkew = 30)

Create a new caching token provider instance.

string
getJwt()

Get the JWT, minting a fresh one when the cached token nears expiry.

int|null
expiresAt(string $jwt)

Extract the "exp" claim from the given JWT, if any.

Details

__construct(TokenProviderInterface $provider, int $clockSkew = 30)

Create a new caching token provider instance.

Parameters

TokenProviderInterface $provider
int $clockSkew

string getJwt()

Get the JWT, minting a fresh one when the cached token nears expiry.

Return Value

string

protected int|null expiresAt(string $jwt)

Extract the "exp" claim from the given JWT, if any.

Parameters

string $jwt

Return Value

int|null