Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preserve id_token and profile even if no openid is in scope of refresh request #763

Merged
merged 1 commit into from
Nov 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions src/ResponseValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,17 +94,16 @@ export class ResponseValidator {

// OpenID Connect Core 1.0 says that id_token is optional in refresh response:
// https://openid.net/specs/openid-connect-core-1_0.html#RefreshTokenResponse
if (response.isOpenId) {
if (response.id_token) {
this._validateIdTokenAttributes(response, state.id_token);
logger.debug("ID Token validated");
}
else {
// if there's no id_token on the response, copy over id_token from original request
response.id_token = state.id_token;
// and decoded part too
response.profile = state.profile;
}
if (response.isOpenId && !!response.id_token) {
this._validateIdTokenAttributes(response, state.id_token);
pamapa marked this conversation as resolved.
Show resolved Hide resolved
logger.debug("ID Token validated");
}

if (!response.id_token) {
// if there's no id_token on the response, copy over id_token from original request
response.id_token = state.id_token;
// and decoded part too
response.profile = state.profile;
}

const hasIdToken = response.isOpenId && !!response.id_token;
Expand Down