JwtAuth
in package
FinalYes
JwtAuth.
Table of Contents
Properties
- $configuration : Configuration
- $issuer : string
- $lifetime : int
Methods
- __construct() : mixed
- The constructor.
- createJwt() : string
- Create JSON web token.
- getLifetime() : int
- validateToken() : Plain|null
- Validate the access token.
- createParsedToken() : Plain
- Parse token.
Properties
$configuration
private
Configuration
$configuration
$issuer
private
string
$issuer
The issuer name
$lifetime
private
int
$lifetime
Max lifetime in seconds
Methods
__construct()
The constructor.
public
__construct(Configuration $configuration, string $issuer, int $lifetime) : mixed
Parameters
- $configuration : Configuration
- $issuer : string
-
The issuer name
- $lifetime : int
-
The max lifetime in seconds
createJwt()
Create JSON web token.
public
createJwt(array<string|int, string> $claims) : string
Parameters
- $claims : array<string|int, string>
-
The claims
Return values
string —The JWT
getLifetime()
public
getLifetime() : int
Return values
intvalidateToken()
Validate the access token.
public
validateToken(string $accessToken) : Plain|null
Parameters
- $accessToken : string
-
The JWT
Return values
Plain|null —The token, if valid
createParsedToken()
Parse token.
private
createParsedToken(string $token) : Plain
Parameters
- $token : string
-
The JWT
Tags
Return values
Plain —The parsed token