Skip to content

Commit

Permalink
fix: change conformIdTokenClaims default value to true
Browse files Browse the repository at this point in the history
BREAKING CHANGE: change conformIdTokenClaims default value to true
  • Loading branch information
panva committed Sep 26, 2018
1 parent 35f13bc commit ef40f6d
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -747,7 +747,7 @@ Enable/disable features.
backchannelLogout: false,
claimsParameter: false,
clientCredentials: false,
conformIdTokenClaims: false,
conformIdTokenClaims: true,
deviceCode: false,
encryption: false,
frontchannelLogout: false,
Expand Down
1 change: 0 additions & 1 deletion example/support/configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ module.exports.provider = {

backchannelLogout: true, // defaults to false
claimsParameter: true, // defaults to false
conformIdTokenClaims: true, // defaults to false
deviceCode: true, // defaults to false
encryption: true, // defaults to false
frontchannelLogout: true, // defaults to false
Expand Down
2 changes: 1 addition & 1 deletion lib/helpers/defaults.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ const DEFAULTS = {
* @skip
*
*/
conformIdTokenClaims: false, // TODO: true in next major
conformIdTokenClaims: true,

/*
* features.deviceCode
Expand Down
8 changes: 4 additions & 4 deletions test/device_code/device_code_grant.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ function errorDetail(spy) {
return spy.args[0][0].error_detail;
}

describe('grant_type=urn:ietf:params:oauth:grant-type:device_code w/ conformIdTokenClaims', () => {
before(bootstrap(__dirname, { config: 'device_code_conform' }));
describe('grant_type=urn:ietf:params:oauth:grant-type:device_code w/ conformIdTokenClaims=false', () => {
before(bootstrap(__dirname, { config: 'device_code_non_conform' })); // agent

it('returns the right stuff', async function () {
const spy = sinon.spy();
Expand All @@ -39,7 +39,7 @@ describe('grant_type=urn:ietf:params:oauth:grant-type:device_code w/ conformIdTo
})
.expect((response) => {
expect(response.body).to.have.keys('access_token', 'id_token', 'expires_in', 'token_type', 'scope', 'refresh_token');
expect(JSON.parse(base64url.decode(response.body.id_token.split('.')[1]))).not.to.have.property('given_name');
expect(JSON.parse(base64url.decode(response.body.id_token.split('.')[1]))).to.have.property('given_name');
});
});
});
Expand Down Expand Up @@ -71,7 +71,7 @@ describe('grant_type=urn:ietf:params:oauth:grant-type:device_code', () => {
})
.expect((response) => {
expect(response.body).to.have.keys('access_token', 'id_token', 'expires_in', 'token_type', 'scope', 'refresh_token');
expect(JSON.parse(base64url.decode(response.body.id_token.split('.')[1]))).to.have.property('given_name');
expect(JSON.parse(base64url.decode(response.body.id_token.split('.')[1]))).not.to.have.property('given_name');
});
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ const { cloneDeep } = require('lodash');

const config = cloneDeep(require('./device_code.config'));

config.config.features.conformIdTokenClaims = true;
config.config.features.conformIdTokenClaims = false;

module.exports = config;

0 comments on commit ef40f6d

Please sign in to comment.