Skip to content

Commit

Permalink
fix: forbid "none" id token algorithm when backchannel logout is used
Browse files Browse the repository at this point in the history
  • Loading branch information
panva committed Dec 6, 2019
1 parent bb86ab8 commit 797919e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/helpers/client_schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ module.exports = function getSchema(provider) {
this.redirectUris();
this.webMessageUris();
this.checkContacts();
this.backchannelLogoutNeedsIdTokenAlg();

// max_age and client_secret_expires_at format
['default_max_age', 'client_secret_expires_at'].forEach((prop) => {
Expand Down Expand Up @@ -583,6 +584,12 @@ module.exports = function getSchema(provider) {
});
}

backchannelLogoutNeedsIdTokenAlg() {
if (this.backchannel_logout_uri && this.id_token_signed_response_alg === 'none') {
this.invalidate('id_token_signed_response_alg must not be "none" when backchannel_logout_uri is used');
}
}

scopes() {
if (this.scope) {
const parsed = new Set(this.scope.split(' '));
Expand Down
1 change: 1 addition & 0 deletions test/configuration/client_metadata.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -1014,6 +1014,7 @@ describe('Client metadata validation', () => {
defaultsTo(this.title, undefined);
mustBeString(this.title, undefined, undefined, configuration);
mustBeUri(this.title, ['http', 'https'], configuration);
rejects(this.title, 'https://rp.example.com/bcl', 'id_token_signed_response_alg must not be "none" when backchannel_logout_uri is used', { id_token_signed_response_alg: 'none' }, configuration);
});

context('backchannel_logout_session_required', function () {
Expand Down

0 comments on commit 797919e

Please sign in to comment.