1 | <?php declare(strict_types = 1); |
||
21 | class JwtAuthenticationListener implements ListenerInterface |
||
22 | { |
||
23 | const HEADER_AUTH = 'Authorization'; |
||
24 | |||
25 | /** |
||
26 | * @var TokenStorageInterface |
||
27 | */ |
||
28 | protected $tokenStorage; |
||
29 | |||
30 | /** |
||
31 | * @var AuthenticationManagerInterface |
||
32 | */ |
||
33 | protected $authenticationManager; |
||
34 | |||
35 | /** |
||
36 | * @var string |
||
37 | */ |
||
38 | private $header; |
||
39 | |||
40 | /** |
||
41 | * @param TokenStorageInterface $tokenStorage |
||
42 | * @param AuthenticationManagerInterface $authenticationManager |
||
43 | * @param string $header |
||
44 | */ |
||
45 | public function __construct(TokenStorageInterface $tokenStorage, AuthenticationManagerInterface $authenticationManager, string $header = self::HEADER_AUTH) |
||
51 | |||
52 | /** |
||
53 | * @param GetResponseEvent $event |
||
54 | */ |
||
55 | public function handle(GetResponseEvent $event) |
||
63 | |||
64 | /** |
||
65 | * @param Request $request |
||
66 | * |
||
67 | * @return JwtAuthenticationToken|null |
||
68 | */ |
||
69 | public function createToken(Request $request) |
||
83 | } |
||
84 |