1 | <?php |
||
28 | abstract class AuthorizationEndpoint implements MiddlewareInterface |
||
29 | { |
||
30 | /** |
||
31 | * @var UserAccountDiscovery |
||
32 | */ |
||
33 | protected $userAccountDiscovery; |
||
34 | |||
35 | /** |
||
36 | * @var UserAccountCheckerManager |
||
37 | */ |
||
38 | protected $userAccountCheckerManager; |
||
39 | |||
40 | /** |
||
41 | * @var ExtensionManager |
||
42 | */ |
||
43 | protected $consentScreenExtensionManager; |
||
44 | |||
45 | /** |
||
46 | * @var AuthorizationRequestLoader |
||
47 | */ |
||
48 | protected $authorizationRequestLoader; |
||
49 | |||
50 | /** |
||
51 | * @var ParameterCheckerManager |
||
52 | */ |
||
53 | protected $parameterCheckerManager; |
||
54 | |||
55 | /** |
||
56 | * @var MessageFactory |
||
57 | */ |
||
58 | protected $messageFactory; |
||
59 | |||
60 | /** |
||
61 | * AuthorizationEndpoint constructor. |
||
62 | * |
||
63 | * @param MessageFactory $messageFactory |
||
64 | * @param AuthorizationRequestLoader $authorizationRequestLoader |
||
65 | * @param ParameterCheckerManager $parameterCheckerManager |
||
66 | * @param UserAccountDiscovery $userAccountDiscovery |
||
67 | * @param UserAccountCheckerManager $userAccountCheckerManager |
||
68 | * @param ExtensionManager $consentScreenExtensionManager |
||
69 | */ |
||
70 | public function __construct(MessageFactory $messageFactory, AuthorizationRequestLoader $authorizationRequestLoader, ParameterCheckerManager $parameterCheckerManager, UserAccountDiscovery $userAccountDiscovery, UserAccountCheckerManager $userAccountCheckerManager, ExtensionManager $consentScreenExtensionManager) |
||
79 | |||
80 | /** |
||
81 | * @param ServerRequestInterface $request |
||
82 | * @param Authorization $authorization |
||
83 | * |
||
84 | * @return ResponseInterface |
||
85 | */ |
||
86 | abstract protected function redirectToLoginPage(ServerRequestInterface $request, Authorization $authorization): ResponseInterface; |
||
87 | |||
88 | /** |
||
89 | * @param ServerRequestInterface $request |
||
90 | * @param Authorization $authorization |
||
91 | * |
||
92 | * @return ResponseInterface |
||
93 | */ |
||
94 | abstract protected function processConsentScreen(ServerRequestInterface $request, Authorization $authorization): ResponseInterface; |
||
95 | |||
96 | /** |
||
97 | * {@inheritdoc} |
||
98 | */ |
||
99 | public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface |
||
142 | |||
143 | /** |
||
144 | * @param Authorization $authorization |
||
145 | * |
||
146 | * @return ResponseInterface |
||
147 | */ |
||
148 | protected function buildResponse(Authorization $authorization): ResponseInterface |
||
161 | |||
162 | /** |
||
163 | * @param Authorization $authorization |
||
164 | * @param string $error |
||
165 | * @param string $error_description |
||
166 | */ |
||
167 | protected function throwRedirectionException(Authorization $authorization, string $error, string $error_description) |
||
180 | |||
181 | /** |
||
182 | * @param ServerRequestInterface $request |
||
183 | * |
||
184 | * @return Authorization |
||
185 | */ |
||
186 | public function createAuthorizationFromRequest(ServerRequestInterface $request): Authorization |
||
193 | } |
||
194 |