| 1 |
<?php |
| 2 |
|
| 3 |
declare(strict_types=1); |
| 4 |
|
| 5 |
namespace Facile\JoseVerifier\Builder; |
| 6 |
|
| 7 |
use Facile\JoseVerifier\Exception\InvalidArgumentException; |
| 8 |
use Facile\JoseVerifier\JWTVerifier; |
| 9 |
use Facile\JoseVerifier\TokenVerifierInterface; |
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
final class AccessTokenVerifierBuilder extends AbstractTokenVerifierBuilder |
| 20 |
{ |
| 21 |
|
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
public static function create(array $issuerMetadata, array $clientMetadata): static |
| 26 |
{ |
| 27 |
return new self($issuerMetadata, $clientMetadata); |
| 28 |
} |
| 29 |
|
| 30 |
|
| 31 |
|
| 32 |
|
| 33 |
public function build(): JWTVerifier |
| 34 |
{ |
| 35 |
return new JWTVerifier( |
| 36 |
$this->getIssuer(), |
| 37 |
$this->getClientId(), |
| 38 |
$this->getClientSecret(), |
| 39 |
$this->getAuthTimeRequired(), |
| 40 |
$this->clockTolerance, |
| 41 |
$this->aadIssValidation, |
| 42 |
$this->getExpectedAzp(), |
| 43 |
$this->getExpectedAlg(), |
| 44 |
$this->getJwksProvider(), |
| 45 |
$this->buildDecrypter() |
| 46 |
); |
| 47 |
} |
| 48 |
|
| 49 |
protected function getExpectedAlg(): ?string |
| 50 |
{ |
| 51 |
return null; |
| 52 |
} |
| 53 |
|
| 54 |
protected function getExpectedEncAlg(): ?string |
| 55 |
{ |
| 56 |
return null; |
| 57 |
} |
| 58 |
|
| 59 |
protected function getExpectedEnc(): ?string |
| 60 |
{ |
| 61 |
return null; |
| 62 |
} |
| 63 |
} |