Conditions | 3 |
Paths | 3 |
Total Lines | 22 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
21 | public function extendAuthorizationServerBuilder(AuthorizationServerBuilder $builder) |
||
22 | { |
||
23 | $builder->setAuthorizationRequestBuilder(new PKCEAuthorizationRequestBuilder( |
||
24 | $builder->getStorageManager()->getClientStorage(), |
||
25 | $builder->getResponseTypeManager(), |
||
26 | $builder->getResponseModeManager(), |
||
27 | $builder->getScopePolicyManager() |
||
28 | )); |
||
29 | |||
30 | $authorizationCodeStorage = $builder->getStorageManager()->getAuthorizationCodeStorage(); |
||
31 | if(!$authorizationCodeStorage instanceof PKCEAuthorizationCodeStorageInterface) { |
||
32 | throw new \InvalidArgumentException('Authorization code storage must be an instance of "' . PKCEAuthorizationCodeStorageInterface::class . '"'); |
||
33 | } |
||
34 | |||
35 | $authorizationCodeFlow = $builder->getFlowManager()->getFlow('authorization_code'); |
||
36 | if (!$authorizationCodeFlow instanceof AuthorizationCodeFlow) { |
||
37 | throw new \InvalidArgumentException('Flow with key "authorization_code" must be an instance of "' . AuthorizationCodeFlow::class . '"'); |
||
38 | } |
||
39 | |||
40 | $builder->getFlowManager()->addFlow('authorization_code', new PKCEAuthorizationCodeFlow( |
||
41 | $authorizationCodeFlow, |
||
42 | $authorizationCodeStorage |
||
43 | )); |
||
45 | } |