toolkit

Jwt

Signed JSON Web Tokens: RS256 verification against a provider's published keys (its JWKS).

Jwt:: Phlat\Toolkit\Jwt 1 methods
  • verify Returns the claims of $token once its signature checks out against $keys (the "keys" list of a provider's jwks_uri) and it has not expired.

Methods

Jwt::verify(string $token, array $keys): array

Returns the claims of $token once its signature checks out against $keys (the "keys" list of a provider's jwks_uri) and it has not expired.

Throws \InvalidArgumentException otherwise. Only RS256 is accepted: a token that names "none" or a shared-secret algorithm would pick how it is checked.

Parameters (2)
$token string
$keys array

Returns array

phlat/src/Toolkit/Jwt.php:19