@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | ? $metadata->getUserinfoSignedResponseAlg() |
79 | 79 | : $metadata->getIdTokenSignedResponseAlg(); |
80 | 80 | |
81 | - if (! $expectedAlg) { |
|
81 | + if (!$expectedAlg) { |
|
82 | 82 | throw new RuntimeException('Unable to verify id_token without an alg value'); |
83 | 83 | } |
84 | 84 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | |
91 | 91 | $payload = \json_decode(base64url_decode(\explode('.', $idToken)[1] ?? '{}'), true); |
92 | 92 | |
93 | - if (! \is_array($payload)) { |
|
93 | + if (!\is_array($payload)) { |
|
94 | 94 | throw new InvalidArgumentException('Unable to decode token payload'); |
95 | 95 | } |
96 | 96 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | |
116 | 116 | $requiredClaims = []; |
117 | 117 | |
118 | - if (! $fromUserInfo) { |
|
118 | + if (!$fromUserInfo) { |
|
119 | 119 | $requiredClaims = ['iss', 'sub', 'aud', 'exp', 'iat']; |
120 | 120 | } |
121 | 121 | |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | |
140 | 140 | $jwks = $this->getSigningJWKSet($client, $expectedAlg, $kid); |
141 | 141 | |
142 | - if (! $this->jwsVerifier->verifyWithKeySet($jws, $jwks, 0)) { |
|
142 | + if (!$this->jwsVerifier->verifyWithKeySet($jws, $jwks, 0)) { |
|
143 | 143 | throw new InvalidArgumentException('Failed to validate JWT signature'); |
144 | 144 | } |
145 | 145 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | |
161 | 161 | $clientSecret = $metadata->getClientSecret(); |
162 | 162 | |
163 | - if (! $clientSecret) { |
|
163 | + if (!$clientSecret) { |
|
164 | 164 | throw new RuntimeException('Unable to verify token without client_secret'); |
165 | 165 | } |
166 | 166 | |
@@ -173,12 +173,12 @@ discard block |
||
173 | 173 | |
174 | 174 | $jwk = $jwks->selectKey('sig', null, ['kid' => $kid]); |
175 | 175 | |
176 | - if (! $jwk) { |
|
176 | + if (!$jwk) { |
|
177 | 177 | $issuer->updateJwks(); |
178 | 178 | $jwk = $issuer->getJwks()->selectKey('sig', null, ['kid' => $kid]); |
179 | 179 | } |
180 | 180 | |
181 | - if (! $jwk) { |
|
181 | + if (!$jwk) { |
|
182 | 182 | throw new RuntimeException('Unable to find the jwk with the provided kid: ' . $kid); |
183 | 183 | } |
184 | 184 |
@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | ?JWSSerializer $signatureSerializer = null, |
46 | 46 | ?JWESerializer $encryptionSerializer = null |
47 | 47 | ) { |
48 | - if (! $algorithmManagerFactory) { |
|
48 | + if (!$algorithmManagerFactory) { |
|
49 | 49 | $algorithmManagerFactory = new AlgorithmManagerFactory(); |
50 | 50 | $algorithmManagerFactory->add('none', new None()); |
51 | 51 | $algorithmManagerFactory->add('RS256', new RS256()); |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | 'exp' => \time() + 300, |
85 | 85 | ])); |
86 | 86 | |
87 | - if (! $payload) { |
|
87 | + if (!$payload) { |
|
88 | 88 | throw new RuntimeException('Unable to encode payload'); |
89 | 89 | } |
90 | 90 | |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | $jwk = $client->getJWKS()->selectKey('sig', $this->algorithmManagerFactory->create([$alg])->get($alg)); |
113 | 113 | } |
114 | 114 | |
115 | - if (! $jwk) { |
|
115 | + if (!$jwk) { |
|
116 | 116 | throw new RuntimeException('No key to sign with alg ' . $alg); |
117 | 117 | } |
118 | 118 | |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | $header = \array_filter([ |
122 | 122 | 'alg' => $alg, |
123 | 123 | 'typ' => 'JWT', |
124 | - 'kid' => ! $ktyIsOct && $jwk->has('kid') ? $jwk->get('kid') : null, |
|
124 | + 'kid' => !$ktyIsOct && $jwk->has('kid') ? $jwk->get('kid') : null, |
|
125 | 125 | ]); |
126 | 126 | |
127 | 127 | $jws = $this->jwsBuilder->create() |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | /** @var null|string $alg */ |
140 | 140 | $alg = $metadata->get('request_object_encryption_alg'); |
141 | 141 | |
142 | - if (! $alg) { |
|
142 | + if (!$alg) { |
|
143 | 143 | return $payload; |
144 | 144 | } |
145 | 145 | |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | ); |
156 | 156 | } |
157 | 157 | |
158 | - if (! $jwk) { |
|
158 | + if (!$jwk) { |
|
159 | 159 | throw new RuntimeException('No key to sign with alg ' . $alg); |
160 | 160 | } |
161 | 161 | |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | 'alg' => $alg, |
166 | 166 | 'enc' => $enc, |
167 | 167 | 'cty' => 'JWT', |
168 | - 'kid' => ! $ktyIsOct && $jwk->has('kid') ? $jwk->get('kid') : null, |
|
168 | + 'kid' => !$ktyIsOct && $jwk->has('kid') ? $jwk->get('kid') : null, |
|
169 | 169 | ]); |
170 | 170 | |
171 | 171 | $jwe = $this->jweBuilder->create() |