@@ -96,11 +96,11 @@ discard block |
||
| 96 | 96 | return $this->resourceOwner->authenticate($this->prompt == self::PROMPT_SELECT_ACCOUNT, $this->loginHint); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | - if($this->idTokenHint) { |
|
| 99 | + if ($this->idTokenHint) { |
|
| 100 | 100 | // check if user associated to this id token is the current user. |
| 101 | 101 | // var_dump($this->idTokenHint['sub']);die; |
| 102 | - if($this->idTokenHint['sub'] !== $this->resourceOwner->getIdentifier()) { |
|
| 103 | - if($this->prompt == self::PROMPT_NONE) { |
|
| 102 | + if ($this->idTokenHint['sub'] !== $this->resourceOwner->getIdentifier()) { |
|
| 103 | + if ($this->prompt == self::PROMPT_NONE) { |
|
| 104 | 104 | throw new OAuthException('invalid_request'); |
| 105 | 105 | } |
| 106 | 106 | else { |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | $this->maxAge = empty($requestData['max_age']) ? null : $requestData['max_age']; |
| 161 | 161 | $this->uiLocales = empty($requestData['ui_locales']) ? null : explode(' ', $requestData['ui_locales']); |
| 162 | 162 | |
| 163 | - if(!empty($requestData['id_token_hint'])) { |
|
| 163 | + if (!empty($requestData['id_token_hint'])) { |
|
| 164 | 164 | try { |
| 165 | 165 | $this->idTokenHint = $this->idTokenManager->decode($requestData['id_token_hint']); |
| 166 | 166 | } catch (\Exception $exception) { |
@@ -102,8 +102,7 @@ |
||
| 102 | 102 | if($this->idTokenHint['sub'] !== $this->resourceOwner->getIdentifier()) { |
| 103 | 103 | if($this->prompt == self::PROMPT_NONE) { |
| 104 | 104 | throw new OAuthException('invalid_request'); |
| 105 | - } |
|
| 106 | - else { |
|
| 105 | + } else { |
|
| 107 | 106 | throw new OAuthException('login_required'); |
| 108 | 107 | } |
| 109 | 108 | } |
@@ -445,7 +445,7 @@ |
||
| 445 | 445 | { |
| 446 | 446 | $getter = 'get'.ucfirst($this->snakeToCamel($offset)); |
| 447 | 447 | $result = $this->{$getter}(); |
| 448 | - if(is_object($result)) { |
|
| 448 | + if (is_object($result)) { |
|
| 449 | 449 | return json_encode($result); |
| 450 | 450 | } |
| 451 | 451 | return $result; |
@@ -51,8 +51,8 @@ |
||
| 51 | 51 | } |
| 52 | 52 | |
| 53 | 53 | public function issueIdToken(RegisteredClient $client, |
| 54 | - string $resourceOwnerIdentifier, |
|
| 55 | - array $additionalClaims = []): string |
|
| 54 | + string $resourceOwnerIdentifier, |
|
| 55 | + array $additionalClaims = []): string |
|
| 56 | 56 | { |
| 57 | 57 | $metadata = $client->getMetadata(); |
| 58 | 58 | |
@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | public function decode(string $idToken): IdTokenInterface |
| 38 | 38 | { |
| 39 | 39 | $claims = $this->jwt->decode($idToken, self::KEY, 'HS256'); |
| 40 | - $idToken = new IdToken((array)$claims); |
|
| 40 | + $idToken = new IdToken((array) $claims); |
|
| 41 | 41 | return $idToken; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -60,7 +60,7 @@ discard block |
||
| 60 | 60 | $alg = $metadata->getIdTokenSignedResponseAlg() ?: 'RS256'; |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | - $keys=[]; |
|
| 63 | + $keys = []; |
|
| 64 | 64 | $jwks = $metadata->getJwks(); |
| 65 | 65 | |
| 66 | 66 | if (!empty($jwks)) { |
@@ -135,7 +135,7 @@ discard block |
||
| 135 | 135 | throw new \UnexpectedValueException('Client metadata Id token signed response alg value is unexpected. |
| 136 | 136 | It must end with "256", "384" or "513"'); |
| 137 | 137 | } |
| 138 | - $macAlgorithm = 'sha' . $macAlgorithm; |
|
| 138 | + $macAlgorithm = 'sha'.$macAlgorithm; |
|
| 139 | 139 | |
| 140 | 140 | $hash = hash($macAlgorithm, $target, true); |
| 141 | 141 | $hash = substr($hash, 0, strlen($hash) / 2); |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | \DateTimeInterface $expiresAt, ?array $requestedScopes = null, ?string $redirectUri = null, |
| 25 | 25 | ?string $codeChallenge = null, ?string $codeChallengeMethod = null) |
| 26 | 26 | { |
| 27 | - parent::__construct($code, $scopes, $clientIdentifier, $resourceOwnerIdentifier, $expiresAt, $requestedScopes, $redirectUri); |
|
| 27 | + parent::__construct($code, $scopes, $clientIdentifier, $resourceOwnerIdentifier, $expiresAt, $requestedScopes, $redirectUri); |
|
| 28 | 28 | $this->codeChallenge = $codeChallenge; |
| 29 | 29 | $this->codeChallengeMethod = $codeChallengeMethod; |
| 30 | 30 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function __construct(array $scopes) |
| 30 | 30 | { |
| 31 | - if(empty($scopes)) { |
|
| 31 | + if (empty($scopes)) { |
|
| 32 | 32 | throw new \InvalidArgumentException('Scope must not be an empty array'); |
| 33 | 33 | } |
| 34 | 34 | $this->scopes = $scopes; |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | if (!empty($supportedScopes)) { |
| 102 | 102 | if (!empty(array_diff($scopes, $supportedScopes))) { |
| 103 | 103 | throw new OAuthException('invalid_scope', |
| 104 | - 'The request scope is invalid. Supported scopes : ' . implode(', ', $supportedScopes), |
|
| 104 | + 'The request scope is invalid. Supported scopes : '.implode(', ', $supportedScopes), |
|
| 105 | 105 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 106 | 106 | } |
| 107 | 107 | } |
@@ -127,7 +127,7 @@ discard block |
||
| 127 | 127 | if ($client instanceof RegisteredClient && !empty($supportedScopes)) { |
| 128 | 128 | if (!empty(array_diff($scopes, $supportedScopes))) { |
| 129 | 129 | throw new OAuthException('invalid_scope', |
| 130 | - 'The request scope is invalid. Supported scopes : ' . implode(', ', $supportedScopes), |
|
| 130 | + 'The request scope is invalid. Supported scopes : '.implode(', ', $supportedScopes), |
|
| 131 | 131 | 'https://tools.ietf.org/html/rfc6749#section-4.1'); |
| 132 | 132 | } |
| 133 | 133 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | |
| 29 | 29 | public function __construct(array $scopes) |
| 30 | 30 | { |
| 31 | - if(empty($scopes)) { |
|
| 31 | + if (empty($scopes)) { |
|
| 32 | 32 | throw new \InvalidArgumentException('Scope must not be an empty array'); |
| 33 | 33 | } |
| 34 | 34 | $this->scopes = $scopes; |
@@ -63,7 +63,7 @@ |
||
| 63 | 63 | */ |
| 64 | 64 | public function setIssueNewRefreshToken(bool $issueNewRefreshToken): void |
| 65 | 65 | { |
| 66 | - if($issueNewRefreshToken) { |
|
| 66 | + if ($issueNewRefreshToken) { |
|
| 67 | 67 | $this->setRevokeOldRefreshToken(true); |
| 68 | 68 | } |
| 69 | 69 | $this->issueNewRefreshToken = $issueNewRefreshToken; |
@@ -43,7 +43,7 @@ |
||
| 43 | 43 | |
| 44 | 44 | public function getClaims() : array |
| 45 | 45 | { |
| 46 | - return $this->claims; |
|
| 46 | + return $this->claims; |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | /** |