Skip to content

Commit a561dd5

Browse files
Fixed comments
1 parent 986832c commit a561dd5

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

openid_connect.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -131,21 +131,21 @@ function validateIdTokenClaims(r, claims) {
131131
const missingClaims = requiredClaims.filter((claim) => !claims[claim]);
132132

133133
if (missingClaims.length > 0) {
134-
r.error(`OIDC ID Token validation error for " + r.headersIn['host'] + r.uri + ": missing claim(s) ${missingClaims.join(' ')}`);
134+
r.error(`OIDC ID Token validation error for ` + r.headersIn['host'] + r.uri + `: missing claim(s) ${missingClaims.join(' ')}`);
135135
return false;
136136
}
137137

138138
// Check 'iat' validity
139139
const iat = Math.floor(Number(claims.iat));
140140
if (String(iat) !== claims.iat || iat < 1) {
141-
r.error("OIDC ID Token validation error for " + r.headersIn['host'] + r.uri + ": iat claim is not a valid number");
141+
r.error(`OIDC ID Token validation error for ` + r.headersIn['host'] + r.uri + `: iat claim is not a valid number`);
142142
return false;
143143
}
144144

145145
// Audience must include the configured client
146146
const aud = Array.isArray(claims.aud) ? claims.aud : claims.aud.split(',');
147147
if (!aud.includes(r.variables.oidc_client)) {
148-
r.error(`OIDC ID Token validation error for " + r.headersIn['host'] + r.uri + ": aud claim (${claims.aud}) ` +
148+
r.error(`OIDC ID Token validation error for ` + r.headersIn['host'] + r.uri + `: aud claim (${claims.aud}) ` +
149149
`does not include $oidc_client (${r.variables.oidc_client})`);
150150
return false;
151151
}
@@ -160,13 +160,13 @@ function validateIdTokenClaims(r, claims) {
160160
: '';
161161

162162
if (claims.nonce !== clientNonceHash) {
163-
r.error(`OIDC ID Token validation error for " + r.headersIn['host'] + r.uri + ": nonce from token (${claims.nonce}) ` +
163+
r.error(`OIDC ID Token validation error for ` + r.headersIn['host'] + r.uri + `: nonce from token (${claims.nonce}) ` +
164164
`does not match client (${clientNonceHash})`);
165165
return false;
166166
}
167167
} else if (isNewSession(r)) {
168-
r.error("OIDC ID Token validation error for " + r.headersIn['host'] + r.uri + ": " +
169-
"missing nonce claim during initial authentication.");
168+
r.error("OIDC ID Token validation error for " + r.headersIn['host'] + r.uri +
169+
": missing nonce claim during initial authentication.");
170170
return false;
171171
}
172172

@@ -269,7 +269,7 @@ async function refreshTokens(r) {
269269
if (!tokenset.id_token) {
270270
r.error("OIDC refresh response for " + r.headersIn['host'] + r.uri + " did not include id_token");
271271
if (tokenset.error) {
272-
r.error("OIDC for " + r.headersIn['host'] + r.uri + " " + tokenset.error + " " + tokenset.error_description);
272+
r.error("OIDC error for " + r.headersIn['host'] + r.uri + " " + tokenset.error + " " + tokenset.error_description);
273273
}
274274
return null;
275275
}
@@ -373,7 +373,7 @@ async function handleFrontChannelLogout(r) {
373373

374374
const claims = await getTokenClaims(r, sessionJwt);
375375
if (claims.iss !== requestIss) {
376-
r.error("Issuer mismatch during logout for " + r.headersIn['host'] + r.uri + " Received iss: " +
376+
r.error("Issuer mismatch during logout for " + r.headersIn['host'] + r.uri + ": Received iss: " +
377377
requestIss + ", expected: " + claims.iss);
378378
r.return(400, "Issuer mismatch");
379379
return;

0 commit comments

Comments
 (0)