Skip to content

Commit

Permalink
fix: return iss to introspection responses
Browse files Browse the repository at this point in the history
closes #676
  • Loading branch information
panva committed Mar 16, 2020
1 parent 2a95f47 commit f1b6fb4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/actions/introspection.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ module.exports = function introspectionAction(provider) {
exp: token.exp,
iat: token.iat,
sid: token.sid,
iss: token.iss,
iss: provider.issuer,
jti: token.jti, // TODO: in v7.x omit if jti === params.token
aud: token.aud,
scope: token.scope,
Expand Down
6 changes: 5 additions & 1 deletion test/introspection/introspection.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ describe('introspection features', () => {
grantId: 'foo',
clientId: 'client',
scope: 'scope',
aud: 'urn:example:foo',
});

const token = await at.save();
Expand All @@ -37,8 +38,11 @@ describe('introspection features', () => {
.type('form')
.expect(200)
.expect((response) => {
expect(response.body).to.contain.keys('client_id', 'scope', 'sub');
expect(response.body).to.contain.keys('client_id', 'scope', 'sub', 'iss', 'iat', 'exp', 'token_type', 'aud', 'jti');
expect(response.body.sub).to.equal('accountId');
expect(response.body.token_type).to.equal('Bearer');
expect(response.body.iss).to.equal(this.provider.issuer);
expect(response.body.aud).to.equal('urn:example:foo');
});
});

Expand Down

0 comments on commit f1b6fb4

Please sign in to comment.