1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* The MIT License (MIT) |
7
|
|
|
* |
8
|
|
|
* Copyright (c) 2014-2018 Spomky-Labs |
9
|
|
|
* |
10
|
|
|
* This software may be modified and distributed under the terms |
11
|
|
|
* of the MIT license. See the LICENSE file for details. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace OAuth2Framework\ServerBundle\Controller; |
15
|
|
|
|
16
|
|
|
use Http\Message\ResponseFactory; |
17
|
|
|
use OAuth2Framework\Component\AuthorizationEndpoint\AuthorizationEndpoint; |
18
|
|
|
use OAuth2Framework\Component\AuthorizationEndpoint\AuthorizationRequest\AuthorizationRequestLoader; |
19
|
|
|
use OAuth2Framework\Component\AuthorizationEndpoint\Consent\ConsentRepository; |
20
|
|
|
use OAuth2Framework\Component\AuthorizationEndpoint\ParameterChecker\ParameterCheckerManager; |
21
|
|
|
use OAuth2Framework\Component\AuthorizationEndpoint\User\UserAuthenticationCheckerManager; |
22
|
|
|
use OAuth2Framework\Component\AuthorizationEndpoint\User\UserDiscovery; |
23
|
|
|
use Symfony\Component\HttpFoundation\Session\SessionInterface; |
24
|
|
|
use Symfony\Component\Routing\RouterInterface; |
25
|
|
|
|
26
|
|
|
final class AuthorizationEndpointController extends AuthorizationEndpoint |
27
|
|
|
{ |
28
|
|
|
private $router; |
29
|
|
|
|
30
|
|
|
public function __construct(ResponseFactory $responseFactory, AuthorizationRequestLoader $authorizationRequestLoader, ParameterCheckerManager $parameterCheckerManager, UserDiscovery $userManager, UserAuthenticationCheckerManager $userCheckerManager, SessionInterface $session, ?ConsentRepository $consentRepository, RouterInterface $router) |
31
|
|
|
{ |
32
|
|
|
parent::__construct($responseFactory, $authorizationRequestLoader, $parameterCheckerManager, $userManager, $userCheckerManager, $session, $consentRepository); |
33
|
|
|
$this->router = $router; |
34
|
|
|
} |
35
|
|
|
|
36
|
|
|
protected function getRouteFor(string $action, string $authorizationId): string |
37
|
|
|
{ |
38
|
|
|
return $this->router->generate($action, ['authorization_id' => $authorizationId]); |
39
|
|
|
} |
40
|
|
|
} |
41
|
|
|
|