JwtManager
class JwtManager extends Manager implements ManagerContract
Traits
Properties
| protected Repository | $config | The configuration repository instance. |
from Manager |
| protected array | $customCreators | The registered custom driver creators. |
from Manager |
| protected array | $drivers | The array of created "drivers". |
from Manager |
| protected BlacklistContract|null | $blacklist | ||
| protected bool | $blacklistEnabled | ||
| protected array | $validations |
Methods
Get the default driver name.
Dynamically call the default driver instance.
Create an instance of the Lcobucci JWT Driver.
Encode a payload into a token.
Decode a token into its payload.
No description
No description
Refresh a token.
Decode a token for refresh.
Invalidate a token.
Validate that the token is still refreshable.
Determine if the blacklist is enabled.
Get the configured blacklist instance.
Details
in
RebindsCallbacksToSelf at line 18
protected Closure|null
bindCallbackToSelf(Closure $callback)
Bind the provided callback to the class instance.
at line 32
__construct(Container $container, ClaimFactory $claimFactory)
Create a new manager instance.
at line 65
string
getDefaultDriver()
Get the default driver name.
in
Manager at line 53
mixed
driver(UnitEnum|string|null $driver = null)
Get a driver instance.
in
Manager at line 78
protected mixed
createDriver(string $driver)
Create a new driver instance.
in
Manager at line 99
protected mixed
callCustomCreator(string $driver)
Call a custom driver creator.
in
Manager at line 112
Manager
extend(string $driver, Closure $callback)
Register a custom driver creator Closure.
Boot-only. The callback persists in the singleton's customCreators array for the worker lifetime and applies to every subsequent driver resolution.
in
Manager at line 129
array
getDrivers()
Get all of the created "drivers".
in
Manager at line 151
Manager
setContainer(Container $container)
Set the container instance used by the manager.
Tests only. Swaps the singleton's container reference; per-request use races across coroutines and breaks every concurrent driver resolution through this manager.
in
Manager at line 167
Manager
forgetDrivers()
Forget all of the resolved driver instances.
Boot or tests only. Clears the singleton's driver cache; concurrent coroutines may already hold references that next resolution will not share.
in
Manager at line 177
mixed
__call(string $method, array $parameters)
Dynamically call the default driver instance.
at line 47
Lcobucci
createLcobucciDriver()
Create an instance of the Lcobucci JWT Driver.
at line 73
string
encode(array $payload)
Encode a payload into a token.
at line 85
array
decode(string $token, bool $validate = true, bool $checkBlacklist = true)
Decode a token into its payload.
at line 100
protected void
validatePayload(array $payload, bool $refresh = false)
No description
at line 113
protected ValidationContract
getValidation(string $class)
No description
at line 125
string
refresh(string $token, bool $forceForever = false, bool $resetClaims = false, array $customClaims = [], int|false|null $ttl = false)
Refresh a token.
at line 161
protected array
decodeForRefresh(string $token)
Decode a token for refresh.
at line 177
bool
invalidate(string $token, bool $forceForever = false)
Invalidate a token.
at line 192
protected void
validateRefreshWindow(array $payload)
Validate that the token is still refreshable.
at line 209
bool
hasBlacklistEnabled()
Determine if the blacklist is enabled.
at line 217
protected BlacklistContract
blacklist()
Get the configured blacklist instance.