Skip to content

Commit c6c01f1

Browse files
committed
fix: add "exp" to Logout Tokens
closes #1295
1 parent 4ea264e commit c6c01f1

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/models/id_token.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ export default function getIdToken(provider) {
9191
issuer: provider.issuer,
9292
subject: payload.sub,
9393
typ: 'logout+jwt',
94+
expiresIn: 120,
9495
};
9596
encryption = {
9697
alg: client.idTokenEncryptedResponseAlg,

test/backchannel_logout/backchannel_logout.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Back-Channel Logout 1.0', () => {
2626
const header = JSON.parse(base64url.decode(RegExp.$1.split('.')[0]));
2727
expect(header).to.have.property('typ', 'logout+jwt');
2828
const decoded = JSON.parse(base64url.decode(RegExp.$1.split('.')[1]));
29-
expect(decoded).to.have.all.keys('sub', 'events', 'iat', 'aud', 'iss', 'jti', 'sid');
29+
expect(decoded).to.have.all.keys('sub', 'events', 'iat', 'exp', 'aud', 'iss', 'jti', 'sid');
3030
expect(decoded).to.have.property('events').and.eql({ 'http://schemas.openid.net/event/backchannel-logout': {} });
3131
expect(decoded).to.have.property('aud', 'client');
3232
expect(decoded).to.have.property('sub', 'subject');
@@ -45,7 +45,7 @@ describe('Back-Channel Logout 1.0', () => {
4545
.filteringRequestBody((body) => {
4646
expect(body).to.match(/^logout_token=(([\w-]+\.?){3})$/);
4747
const decoded = JSON.parse(base64url.decode(RegExp.$1.split('.')[1]));
48-
expect(decoded).to.have.all.keys('sub', 'events', 'iat', 'aud', 'iss', 'jti');
48+
expect(decoded).to.have.all.keys('sub', 'events', 'iat', 'exp', 'aud', 'iss', 'jti');
4949
expect(decoded).to.have.property('events').and.eql({ 'http://schemas.openid.net/event/backchannel-logout': {} });
5050
expect(decoded).to.have.property('aud', 'no-sid');
5151
expect(decoded).to.have.property('sub', 'subject');

0 commit comments

Comments
 (0)