JwtAuthenticator
in package
implements
Authenticator
Read onlyYes
FinalYes
Tags
Table of Contents
Interfaces
Methods
- __construct() : mixed
- authenticate() : Principal|null
Methods
__construct()
public
__construct(Configuration $jwt[, TokenExtractor|null $extractor = null ][, callable(Plain): Array $claimsMapper = null ][, LoggerInterface|null $logger = null ][, ClockInterface|null $clock = null ][, array<int, non-empty-string> $issuers = [] ][, non-empty-string|null $audience = null ][, non-empty-string|null $subject = null ][, DateInterval|null $leeway = null ]) : mixed
Parameters
- $jwt : Configuration
- $extractor : TokenExtractor|null = null
- $claimsMapper : callable(Plain): Array = null
- $logger : LoggerInterface|null = null
- $clock : ClockInterface|null = null
- $issuers : array<int, non-empty-string> = []
-
Accept only tokens whose
issis one of these (any-of). Empty = do not constrain the issuer. - $audience : non-empty-string|null = null
-
Require the token's
audto contain this. - $subject : non-empty-string|null = null
-
Require the token's
subto equal this. - $leeway : DateInterval|null = null
-
Clock-skew tolerance for time claims. When set, time validity is checked loosely within the leeway; otherwise strictly (no skew allowed).
authenticate()
public
authenticate(ServerRequestInterface $request) : Principal|null
Parameters
- $request : ServerRequestInterface
Attributes
- #[Override]