1 | <?php |
||
24 | class JwtAuthenticator implements AuthenticatorInterface |
||
25 | { |
||
26 | private const ALGORITHM = 'ES256'; |
||
27 | |||
28 | /** |
||
29 | * @var JwtInterface |
||
30 | */ |
||
31 | private $jwt; |
||
32 | |||
33 | /** |
||
34 | * @var string |
||
35 | */ |
||
36 | private $jws; |
||
37 | |||
38 | /** |
||
39 | * @var \DateInterval |
||
40 | */ |
||
41 | private $jwsLifetime; |
||
42 | |||
43 | /** |
||
44 | * @var \DateTime |
||
45 | */ |
||
46 | private $jwsValidTo; |
||
47 | |||
48 | /** |
||
49 | * Constructor. |
||
50 | * |
||
51 | * @param JwtInterface $jwt |
||
52 | * @param \DateInterval $jwsLifetime |
||
53 | * @throws \InvalidArgumentException |
||
54 | */ |
||
55 | public function __construct(JwtInterface $jwt, \DateInterval $jwsLifetime = null) |
||
64 | |||
65 | /** |
||
66 | * {@inheritdoc} |
||
67 | */ |
||
68 | public function authenticate(Request $request): Request |
||
80 | |||
81 | /** |
||
82 | * Create the content of JWS by Json Web Token |
||
83 | * |
||
84 | * @return string |
||
85 | */ |
||
86 | private function createJwsContent(): string |
||
110 | } |
||
111 |