1 | <?php |
||||
2 | |||||
3 | declare(strict_types=1); |
||||
4 | |||||
5 | /* |
||||
6 | * The MIT License (MIT) |
||||
7 | * |
||||
8 | * Copyright (c) 2014-2019 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 | use OAuth2Framework\Component\ClientAuthentication\AuthenticationMethodManager; |
||||
15 | use OAuth2Framework\Component\Core\Message; |
||||
16 | use OAuth2Framework\Component\Core\Middleware; |
||||
17 | use Psr\Http\Message\ResponseFactoryInterface; |
||||
18 | use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator; |
||||
19 | use function Symfony\Component\DependencyInjection\Loader\Configurator\ref; |
||||
20 | |||||
21 | return function (ContainerConfigurator $container) { |
||||
22 | $container = $container->services()->defaults() |
||||
23 | ->private() |
||||
24 | ->autowire() |
||||
25 | ->autoconfigure() |
||||
26 | ; |
||||
27 | |||||
28 | $container->set('oauth2_server.message_middleware.for_client_authentication') |
||||
29 | ->class(Middleware\OAuth2MessageMiddleware::class) |
||||
30 | ->args([ |
||||
31 | ref('oauth2_server.message_factory_manager.for_client_authentication'), |
||||
0 ignored issues
–
show
|
|||||
32 | ]) |
||||
33 | ; |
||||
34 | $container->set('oauth2_server.message_factory_manager.for_client_authentication') |
||||
35 | ->class(Message\OAuth2MessageFactoryManager::class) |
||||
36 | ->args([ |
||||
37 | ref(ResponseFactoryInterface::class), |
||||
0 ignored issues
–
show
The function
Symfony\Component\Depend...ader\Configurator\ref() has been deprecated: since Symfony 5.1, use service() instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
Loading history...
|
|||||
38 | ]) |
||||
39 | ; |
||||
40 | |||||
41 | $container->set('oauth2_server.message_middleware.for_token_authentication') |
||||
42 | ->class(Middleware\OAuth2MessageMiddleware::class) |
||||
43 | ->args([ |
||||
44 | ref('oauth2_server.message_factory_manager.for_token_authentication'), |
||||
0 ignored issues
–
show
The function
Symfony\Component\Depend...ader\Configurator\ref() has been deprecated: since Symfony 5.1, use service() instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
Loading history...
|
|||||
45 | ]) |
||||
46 | ; |
||||
47 | $container->set('oauth2_server.message_factory_manager.for_token_authentication') |
||||
48 | ->class(Message\OAuth2MessageFactoryManager::class) |
||||
49 | ->args([ |
||||
50 | ref(ResponseFactoryInterface::class), |
||||
0 ignored issues
–
show
The function
Symfony\Component\Depend...ader\Configurator\ref() has been deprecated: since Symfony 5.1, use service() instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
Loading history...
|
|||||
51 | ]) |
||||
52 | ; |
||||
53 | |||||
54 | //Factories |
||||
55 | $container->set('oauth2_server.message_factory.403') |
||||
56 | ->class(Message\Factory\AccessDeniedResponseFactory::class) |
||||
57 | ->tag('oauth2_server_message_factory_for_token_authentication') |
||||
58 | ->tag('oauth2_server_message_factory_for_client_authentication') |
||||
59 | ; |
||||
60 | |||||
61 | $container->set('oauth2_server.message_factory.401_for_token') |
||||
62 | ->args([ |
||||
63 | ref(\OAuth2Framework\Component\Core\TokenType\TokenTypeManager::class), |
||||
0 ignored issues
–
show
The function
Symfony\Component\Depend...ader\Configurator\ref() has been deprecated: since Symfony 5.1, use service() instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
Loading history...
|
|||||
64 | ]) |
||||
65 | ->class(Message\Factory\AuthenticateResponseForTokenFactory::class) |
||||
66 | ->tag('oauth2_server_message_factory_for_token_authentication') |
||||
67 | ; |
||||
68 | |||||
69 | $container->set('oauth2_server.message_factory.401_for_client') |
||||
70 | ->args([ |
||||
71 | ref(AuthenticationMethodManager::class), |
||||
0 ignored issues
–
show
The function
Symfony\Component\Depend...ader\Configurator\ref() has been deprecated: since Symfony 5.1, use service() instead.
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
This function has been deprecated. The supplier of the function has supplied an explanatory message. The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.
Loading history...
|
|||||
72 | ]) |
||||
73 | ->class(Message\Factory\AuthenticateResponseForClientFactory::class) |
||||
74 | ->tag('oauth2_server_message_factory_for_client_authentication') |
||||
75 | ; |
||||
76 | |||||
77 | $container->set('oauth2_server.message_factory.400') |
||||
78 | ->class(Message\Factory\BadRequestResponseFactory::class) |
||||
79 | ->tag('oauth2_server_message_factory_for_token_authentication') |
||||
80 | ->tag('oauth2_server_message_factory_for_client_authentication') |
||||
81 | ; |
||||
82 | |||||
83 | $container->set('oauth2_server.message_factory.405') |
||||
84 | ->class(Message\Factory\MethodNotAllowedResponseFactory::class) |
||||
85 | ->tag('oauth2_server_message_factory_for_token_authentication') |
||||
86 | ->tag('oauth2_server_message_factory_for_client_authentication') |
||||
87 | ; |
||||
88 | |||||
89 | $container->set('oauth2_server.message_factory.501') |
||||
90 | ->class(Message\Factory\NotImplementedResponseFactory::class) |
||||
91 | ->tag('oauth2_server_message_factory_for_token_authentication') |
||||
92 | ->tag('oauth2_server_message_factory_for_client_authentication') |
||||
93 | ; |
||||
94 | |||||
95 | $container->set('oauth2_server.message_factory.303') |
||||
96 | ->class(Message\Factory\RedirectResponseFactory::class) |
||||
97 | ->tag('oauth2_server_message_factory_for_token_authentication') |
||||
98 | ->tag('oauth2_server_message_factory_for_client_authentication') |
||||
99 | ; |
||||
100 | }; |
||||
101 |
This function has been deprecated. The supplier of the function has supplied an explanatory message.
The explanatory message should give you some clue as to whether and when the function will be removed and what other function to use instead.