|
MediaWiki master
|
A helper to read and write JWTs without having to depend on a specific library, and using central configuration for the encryption details. More...
Inherited by MediaWiki\Json\RsaJwtCodec.
Public Member Functions | |
| create (array $claims) | |
| Creates a JWT string with the given claims. | |
| isEnabled () | |
| Whether the codec can be used (disabled means it hasn't been properly configured). | |
| parse (string $jwt) | |
| Parses and partially validates a JWT string, and returns the set of claim inside it. | |
A helper to read and write JWTs without having to depend on a specific library, and using central configuration for the encryption details.
Definition at line 12 of file JwtCodec.php.
| MediaWiki\Json\JwtCodec::create | ( | array | $claims | ) |
Creates a JWT string with the given claims.
Implemented in MediaWiki\Json\RsaJwtCodec.
| MediaWiki\Json\JwtCodec::isEnabled | ( | ) |
Whether the codec can be used (disabled means it hasn't been properly configured).
All other methods will throw on a disabled JwtCodec.
Implemented in MediaWiki\Json\RsaJwtCodec.
| MediaWiki\Json\JwtCodec::parse | ( | string | $jwt | ) |
Parses and partially validates a JWT string, and returns the set of claim inside it.
The validation covers the signature and time fields; other checks are left to the caller.
| JwtException | If the JWT is invalid (expired, has invalid signature or can't even be parsed). |
Implemented in MediaWiki\Json\RsaJwtCodec.