Skip to content

Commit 9183e7f

Browse files
committed
OIDC Userinfo: Labelled changes to be made during review
1 parent d640411 commit 9183e7f

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

app/Access/Oidc/OidcService.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,14 +241,23 @@ protected function processAccessTokenCallback(OidcAccessToken $accessToken, Oidc
241241

242242
session()->put("oidc_id_token", $idTokenText);
243243

244+
// TODO - This should not affect id token validation
245+
// TODO - Should only call if we're missing properties
244246
if (!empty($settings->userinfoEndpoint)) {
245247
$provider = $this->getProvider($settings);
246248
$request = $provider->getAuthenticatedRequest('GET', $settings->userinfoEndpoint, $accessToken->getToken());
247249
$response = $provider->getParsedResponse($request);
250+
// TODO - Ensure response content-type is "application/json" before using in this way (5.3.2)
251+
// TODO - The sub Claim in the UserInfo Response MUST be verified to exactly match the sub Claim in the ID Token; if they do not match, the UserInfo Response values MUST NOT be used. (5.3.2)
252+
// TODO - Response validation (5.3.4)
253+
// TODO - Verify that the OP that responded was the intended OP through a TLS server certificate check, per RFC 6125 [RFC6125].
254+
// TODO - If the Client has provided a userinfo_encrypted_response_alg parameter during Registration, decrypt the UserInfo Response using the keys specified during Registration.
255+
// TODO - If the response was signed, the Client SHOULD validate the signature according to JWS [JWS].
248256
$claims = $idToken->getAllClaims();
249257
foreach ($response as $key => $value) {
250258
$claims[$key] = $value;
251259
}
260+
// TODO - Should maybe remain separate from IdToken completely
252261
$idToken->replaceClaims($claims);
253262
}
254263

0 commit comments

Comments
 (0)