Total Complexity | 2 |
Total Lines | 30 |
Duplicated Lines | 0 % |
Coverage | 57.14% |
Changes | 0 |
1 | <?php |
||
11 | class OAuthController extends BaseController |
||
12 | { |
||
13 | /** @var AuthorizationServer $oauth2Server */ |
||
14 | protected $oauth2Server; |
||
15 | |||
16 | 1 | public function init() |
|
17 | { |
||
18 | |||
19 | 1 | $container = ContainerService::getInstance()->getContainer(); |
|
20 | 1 | $clientRepository = $container['repository.Client']; |
|
21 | 1 | $accessTokenRepository = $container['repository.AccessToken']; |
|
22 | 1 | $scopeRepository = $container['repository.Scope']; |
|
23 | |||
24 | // Setup the authorization server |
||
25 | 1 | $server = new AuthorizationServer($clientRepository, $accessTokenRepository, $scopeRepository, |
|
26 | 1 | 'file://'.APPLICATION_PATH.'/data/keys/private.key', // path to private key |
|
27 | 1 | 'file://'.APPLICATION_PATH.'/data/keys/public.key' // path to public key |
|
28 | ); |
||
29 | |||
30 | $this->oauth2Server = $server; |
||
31 | } |
||
32 | |||
33 | /** |
||
34 | * @param ResponseInterface $response |
||
35 | */ |
||
36 | protected function sendResponse(ResponseInterface $response) |
||
41 | } |
||
42 | } |
||
43 |