1 | <?php |
||
16 | final class AudienceChecker implements ClaimCheckerInterface, HeaderCheckerInterface |
||
17 | { |
||
18 | private const CLAIM_NAME = 'aud'; |
||
19 | |||
20 | /** |
||
21 | * @var bool |
||
22 | */ |
||
23 | private $protectedHeader = false; |
||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | private $audience; |
||
28 | |||
29 | /** |
||
30 | * AudienceChecker constructor. |
||
31 | * |
||
32 | * @param string $audience |
||
33 | * @param bool $protectedHeader |
||
34 | */ |
||
35 | public function __construct(string $audience, bool $protectedHeader = false) |
||
40 | |||
41 | /** |
||
42 | * {@inheritdoc} |
||
43 | */ |
||
44 | public function checkClaim($value) |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function checkHeader($value) |
||
56 | |||
57 | /** |
||
58 | * @param $value |
||
59 | * |
||
60 | * @throws \InvalidArgumentException |
||
61 | */ |
||
62 | private function checkValue($value) |
||
70 | |||
71 | /** |
||
72 | * {@inheritdoc} |
||
73 | */ |
||
74 | public function supportedClaim(): string |
||
78 | |||
79 | /** |
||
80 | * {@inheritdoc} |
||
81 | */ |
||
82 | public function supportedHeader(): string |
||
86 | |||
87 | /** |
||
88 | * {@inheritdoc} |
||
89 | */ |
||
90 | public function protectedHeaderOnly(): bool |
||
94 | } |
||
95 |