final class StaticBearerTokenAuthenticator implements ApiAuthenticatorInterface (View source)

Verifies one configured bearer token in constant time and creates an external API identity.

Methods

__construct(string|null $token, array $scopes = [])

Captures the optional token used for later verification and the permissions assigned on success.

authenticate(ServerRequestInterface $request)

Returns an external static-token identity for an exact bearer match, or null otherwise.

Details

__construct

__construct(string|null $token, array $scopes = [])

Captures the optional token used for later verification and the permissions assigned on success.

Parameters

string|null $token
array $scopes

Exceptions

InvalidArgumentException

authenticate

ApiIdentity|null authenticate(ServerRequestInterface $request)

Returns an external static-token identity for an exact bearer match, or null otherwise.

Parameters

ServerRequestInterface $request

Return Value

ApiIdentity|null