@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * WWW-Authenticate: Bearer realm="example" |
| 106 | 106 | */ |
| 107 | 107 | if (!$bearerAuthenticationMethodUsed) { |
| 108 | - return new Response(401, ['WWW-Authenticate' => 'Bearer' . ($realm ? ' realm="example"' : '')]); |
|
| 108 | + return new Response(401, ['WWW-Authenticate' => 'Bearer'.($realm ? ' realm="example"' : '')]); |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | $token = $bearerAuthenticationMethodUsed->authenticate($request); |
@@ -205,14 +205,14 @@ discard block |
||
| 205 | 205 | |
| 206 | 206 | $header = 'Bearer'; |
| 207 | 207 | if ($realm) { |
| 208 | - $header .= ' realm="' . $realm . '"'; |
|
| 208 | + $header .= ' realm="'.$realm.'"'; |
|
| 209 | 209 | } |
| 210 | - $header .= ' error="' . $e->getError() . '"'; |
|
| 210 | + $header .= ' error="'.$e->getError().'"'; |
|
| 211 | 211 | if ($e->getErrorDescription()) { |
| 212 | - $header .= ' error_description="' . $e->getErrorDescription() . '"'; |
|
| 212 | + $header .= ' error_description="'.$e->getErrorDescription().'"'; |
|
| 213 | 213 | } |
| 214 | 214 | if ($e->getErrorUri()) { |
| 215 | - $header .= ' error_uri="' . $e->getErrorUri() . '"'; |
|
| 215 | + $header .= ' error_uri="'.$e->getErrorUri().'"'; |
|
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | return new Response($statusCode, ['WWW-Authenticate' => $header]); |
@@ -53,5 +53,5 @@ |
||
| 53 | 53 | * "scope" value is intended for programmatic use and is not meant to be |
| 54 | 54 | * displayed to end-users. |
| 55 | 55 | */ |
| 56 | - public function verifyRequest(ServerRequestInterface $request, ?string $realm = null, ?string $scope = null): ?ResponseInterface; |
|
| 56 | + public function verifyRequest(ServerRequestInterface $request, ?string $realm = null, ?string $scope = null): ?ResponseInterface; |
|
| 57 | 57 | } |
| 58 | 58 | \ No newline at end of file |
@@ -172,7 +172,7 @@ |
||
| 172 | 172 | } |
| 173 | 173 | } catch (\InvalidArgumentException $e) { |
| 174 | 174 | throw new OAuthException('invalid_request', |
| 175 | - 'The request includes the malformed parameter redirect_uri. ' . $e->getMessage(), |
|
| 175 | + 'The request includes the malformed parameter redirect_uri. '.$e->getMessage(), |
|
| 176 | 176 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 177 | 177 | } |
| 178 | 178 | |
@@ -37,19 +37,19 @@ |
||
| 37 | 37 | */ |
| 38 | 38 | public function build(): StorageManager |
| 39 | 39 | { |
| 40 | - if(!$this->clientStorage) { |
|
| 40 | + if (!$this->clientStorage) { |
|
| 41 | 41 | throw new \InvalidArgumentException('Client storage is missing'); |
| 42 | 42 | } |
| 43 | - if(!$this->resourceOwnerStorage) { |
|
| 43 | + if (!$this->resourceOwnerStorage) { |
|
| 44 | 44 | throw new \InvalidArgumentException('Resource owner storage is missing'); |
| 45 | 45 | } |
| 46 | - if(!$this->authorizationCodeStorage) { |
|
| 46 | + if (!$this->authorizationCodeStorage) { |
|
| 47 | 47 | throw new \InvalidArgumentException('Authorization code storage is missing'); |
| 48 | 48 | } |
| 49 | - if(!$this->accessTokenStorage) { |
|
| 49 | + if (!$this->accessTokenStorage) { |
|
| 50 | 50 | throw new \InvalidArgumentException('Access token storage is missing'); |
| 51 | 51 | } |
| 52 | - if(!$this->refreshTokenStorage) { |
|
| 52 | + if (!$this->refreshTokenStorage) { |
|
| 53 | 53 | throw new \InvalidArgumentException('Refresh token storage is missing'); |
| 54 | 54 | } |
| 55 | 55 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | $codeChallenge = $authorizationRequest->getData()['code_challenge'] ?? null; |
| 35 | 35 | |
| 36 | 36 | $codeChallengeMethod = 'plain'; |
| 37 | - if(!empty($authorizationRequest->getData()['code_challenge_method'])) { |
|
| 37 | + if (!empty($authorizationRequest->getData()['code_challenge_method'])) { |
|
| 38 | 38 | $codeChallengeMethod = $authorizationRequest->getData()['code_challenge_method']; |
| 39 | 39 | } |
| 40 | 40 | |
@@ -22,6 +22,6 @@ |
||
| 22 | 22 | * TODO utiliser un builder |
| 23 | 23 | */ |
| 24 | 24 | public function setCodeChallenge(AuthorizationCodeInterface $authorizationCode, string $codeChallenge, |
| 25 | - string $codeChallengeMethod = 'plain'); |
|
| 25 | + string $codeChallengeMethod = 'plain'); |
|
| 26 | 26 | |
| 27 | 27 | } |
| 28 | 28 | \ No newline at end of file |
@@ -62,7 +62,7 @@ |
||
| 62 | 62 | |
| 63 | 63 | public function build() |
| 64 | 64 | { |
| 65 | - $scopePolicyManager= new ScopePolicyManager($this->config->getScopePolicy()); |
|
| 65 | + $scopePolicyManager = new ScopePolicyManager($this->config->getScopePolicy()); |
|
| 66 | 66 | $storageManager = $this->storages->build(); |
| 67 | 67 | |
| 68 | 68 | $authorizationServerBuilder = new AuthorizationServerBuilder($this->config, $storageManager, $scopePolicyManager, $this->endUser); |
@@ -28,13 +28,13 @@ |
||
| 28 | 28 | )); |
| 29 | 29 | |
| 30 | 30 | $authorizationCodeStorage = $builder->getStorageManager()->getAuthorizationCodeStorage(); |
| 31 | - if(!$authorizationCodeStorage instanceof PKCEAuthorizationCodeStorageInterface) { |
|
| 32 | - throw new \InvalidArgumentException('Authorization code storage must be an instance of "' . PKCEAuthorizationCodeStorageInterface::class . '"'); |
|
| 31 | + if (!$authorizationCodeStorage instanceof PKCEAuthorizationCodeStorageInterface) { |
|
| 32 | + throw new \InvalidArgumentException('Authorization code storage must be an instance of "'.PKCEAuthorizationCodeStorageInterface::class.'"'); |
|
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | $authorizationCodeFlow = $builder->getFlowManager()->getFlow('authorization_code'); |
| 36 | 36 | if (!$authorizationCodeFlow instanceof AuthorizationCodeFlow) { |
| 37 | - throw new \InvalidArgumentException('Flow with key "authorization_code" must be an instance of "' . AuthorizationCodeFlow::class . '"'); |
|
| 37 | + throw new \InvalidArgumentException('Flow with key "authorization_code" must be an instance of "'.AuthorizationCodeFlow::class.'"'); |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | $builder->getFlowManager()->addFlow('authorization_code', new PKCEAuthorizationCodeFlow( |
@@ -67,7 +67,7 @@ |
||
| 67 | 67 | |
| 68 | 68 | public function getData(): array |
| 69 | 69 | { |
| 70 | - return $this->authorizationRequest->getData(); |
|
| 70 | + return $this->authorizationRequest->getData(); |
|
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | /** |