1 | <?php namespace Limoncello\Passport\Integration; |
||
39 | abstract class BasePassportServerIntegration implements PassportServerIntegrationInterface |
||
40 | { |
||
41 | /** Approval parameter */ |
||
42 | const SCOPE_APPROVAL_TYPE = 'type'; |
||
43 | |||
44 | /** Approval parameter */ |
||
45 | const SCOPE_APPROVAL_CLIENT_ID = 'client_id'; |
||
46 | |||
47 | /** Approval parameter */ |
||
48 | const SCOPE_APPROVAL_CLIENT_NAME = 'client_name'; |
||
49 | |||
50 | /** Approval parameter */ |
||
51 | const SCOPE_APPROVAL_REDIRECT_URI = 'redirect_uri'; |
||
52 | |||
53 | /** Approval parameter */ |
||
54 | const SCOPE_APPROVAL_IS_SCOPE_MODIFIED = 'is_scope_modified'; |
||
55 | |||
56 | /** Approval parameter */ |
||
57 | const SCOPE_APPROVAL_SCOPE = 'scope'; |
||
58 | |||
59 | /** Approval parameter */ |
||
60 | const SCOPE_APPROVAL_STATE = 'state'; |
||
61 | |||
62 | /** |
||
63 | * @var ContainerInterface |
||
64 | */ |
||
65 | private $container; |
||
66 | |||
67 | /** |
||
68 | * @var array |
||
69 | */ |
||
70 | private $settings; |
||
71 | |||
72 | /** |
||
73 | * @var string |
||
74 | */ |
||
75 | private $defaultClientId; |
||
76 | |||
77 | /** |
||
78 | * @var Connection |
||
79 | */ |
||
80 | private $connection; |
||
81 | |||
82 | /** |
||
83 | * @var DatabaseSchemeInterface |
||
84 | */ |
||
85 | private $databaseScheme; |
||
86 | |||
87 | /** |
||
88 | * @var string |
||
89 | */ |
||
90 | private $approvalUriString; |
||
91 | |||
92 | /** |
||
93 | * @var string |
||
94 | */ |
||
95 | private $errorUriString; |
||
96 | |||
97 | /** |
||
98 | * @var int |
||
99 | */ |
||
100 | private $codeExpiration; |
||
101 | |||
102 | /** |
||
103 | * @var int |
||
104 | */ |
||
105 | private $tokenExpiration; |
||
106 | /** |
||
107 | * @var bool |
||
108 | */ |
||
109 | private $isRenewRefreshValue; |
||
110 | |||
111 | /** |
||
112 | * @var callable|null |
||
113 | */ |
||
114 | private $customPropProvider; |
||
115 | |||
116 | /** |
||
117 | * @param ContainerInterface $container |
||
118 | */ |
||
119 | public function __construct(ContainerInterface $container) |
||
143 | |||
144 | /** |
||
145 | * @inheritdoc |
||
146 | */ |
||
147 | public function validateUserId(string $userName, string $password) |
||
154 | |||
155 | /** |
||
156 | * @inheritdoc |
||
157 | */ |
||
158 | public function verifyAllowedUserScope(int $userIdentity, array $scope = null) |
||
165 | |||
166 | /** |
||
167 | * @inheritdoc |
||
168 | */ |
||
169 | public function getDefaultClientIdentifier(): string |
||
173 | |||
174 | /** |
||
175 | * @inheritdoc |
||
176 | */ |
||
177 | public function generateCodeValue(TokenInterface $token): string |
||
185 | |||
186 | /** |
||
187 | * @inheritdoc |
||
188 | */ |
||
189 | public function generateTokenValues(TokenInterface $token): array |
||
203 | |||
204 | /** |
||
205 | * @inheritdoc |
||
206 | */ |
||
207 | public function getCodeExpirationPeriod(): int |
||
211 | |||
212 | /** |
||
213 | * @inheritdoc |
||
214 | */ |
||
215 | public function getTokenExpirationPeriod(): int |
||
219 | |||
220 | /** |
||
221 | * @inheritdoc |
||
222 | */ |
||
223 | public function isRenewRefreshValue(): bool |
||
227 | |||
228 | /** |
||
229 | * @inheritdoc |
||
230 | */ |
||
231 | public function createInvalidClientAndRedirectUriErrorResponse(): ResponseInterface |
||
235 | |||
236 | /** @noinspection PhpTooManyParametersInspection |
||
237 | * @inheritdoc |
||
238 | * |
||
239 | * @SuppressWarnings(PHPMD.BooleanArgumentFlag) |
||
240 | */ |
||
241 | public function createAskResourceOwnerForApprovalResponse( |
||
269 | |||
270 | /** |
||
271 | * @inheritdoc |
||
272 | */ |
||
273 | public function verifyClientCredentials(ClientInterface $client, string $credentials): bool |
||
280 | |||
281 | /** |
||
282 | * @inheritdoc |
||
283 | */ |
||
284 | public function getBodyTokenExtraParameters(TokenInterface $token): array |
||
288 | |||
289 | /** |
||
290 | * @param string $uri |
||
291 | * @param array $data |
||
292 | * |
||
293 | * @return UriInterface |
||
294 | */ |
||
295 | protected function createRedirectUri(string $uri, array $data): UriInterface |
||
302 | |||
303 | /** |
||
304 | * @return Connection |
||
305 | */ |
||
306 | protected function getConnection(): Connection |
||
310 | |||
311 | /** |
||
312 | * @return DatabaseSchemeInterface |
||
313 | */ |
||
314 | protected function getDatabaseScheme(): DatabaseSchemeInterface |
||
322 | |||
323 | /** |
||
324 | * @return string |
||
325 | */ |
||
326 | protected function getApprovalUriString(): string |
||
330 | |||
331 | /** |
||
332 | * @return string |
||
333 | */ |
||
334 | protected function getErrorUriString(): string |
||
338 | } |
||
339 |