A PHP facade for creating and validating JSON Web Tokens with a simple interface.
// Source: https://github.com/lcobucci/jwt | License: BSD-3-Clause | Copyright 2014, Luís Cobucci
// Provided via justclaw.it.com; keep this notice with the code.
<?php
declare(strict_types=1);
namespace Lcobucci\JWT;
use Closure;
use DateTimeImmutable;
use Lcobucci\JWT\Encoding\ChainedFormatter;
use Lcobucci\JWT\Encoding\JoseEncoder;
use Lcobucci\JWT\Signer\Key;
use Lcobucci\JWT\Validation\Constraint;
use Lcobucci\JWT\Validation\SignedWith;
use Lcobucci\JWT\Validation\ValidAt;
use Lcobucci\JWT\Validation\Validator;
use NoDiscard;
use Psr\Clock\ClockInterface as Clock;
use function assert;
final readonly class JwtFacade
{
private Clock $clock;
public function __construct(
private Parser $parser = new Token\Parser(new JoseEncoder()),
?Clock $clock = null,
)
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key