openid-client
Advanced tools
Comparing version 0.5.2 to 0.5.3
Following semver, 1.0.0 will mark the first API stable release and commence of this file, | ||
until then please use the compare views of github for reference. | ||
- https://github.com/panva/node-openid-client/compare/v0.5.0...v0.5.2 | ||
- https://github.com/panva/node-openid-client/compare/v0.5.0...v0.5.3 | ||
- added: token_type_hint for introspection and revocation | ||
- fix: handle refresh w/o id_token | ||
@@ -6,0 +7,0 @@ - fix: ignore nonce values when refreshing w/ id_token |
@@ -361,16 +361,23 @@ 'use strict'; | ||
revoke(token) { | ||
revoke(token, hint) { | ||
assert.ok(this.issuer.revocation_endpoint || this.issuer.token_revocation_endpoint, | ||
'issuer must be configured with revocation endpoint'); | ||
assert.ok(!hint || typeof hint === 'string', 'hint must be a string'); | ||
const endpoint = this.issuer.revocation_endpoint || this.issuer.token_revocation_endpoint; | ||
return this.authenticatedPost(endpoint, { body: { token } }, | ||
const body = { token }; | ||
if (hint) body.token_type_hint = hint; | ||
return this.authenticatedPost(endpoint, { body }, | ||
response => JSON.parse(response.body)); | ||
} | ||
introspect(token) { | ||
introspect(token, hint) { | ||
assert.ok(this.issuer.introspection_endpoint || this.issuer.token_introspection_endpoint, | ||
'issuer must be configured with introspection endpoint'); | ||
assert.ok(!hint || typeof hint === 'string', 'hint must be a string'); | ||
const endpoint = this.issuer.introspection_endpoint || this.issuer.token_introspection_endpoint; | ||
return this.authenticatedPost(endpoint, { body: { token } }, | ||
const body = { token }; | ||
if (hint) body.token_type_hint = hint; | ||
return this.authenticatedPost(endpoint, { body }, | ||
response => JSON.parse(response.body)); | ||
@@ -377,0 +384,0 @@ } |
{ | ||
"name": "openid-client", | ||
"version": "0.5.2", | ||
"version": "0.5.3", | ||
"description": "OpenID Connect Relying Party (RP, Client) implementation for Node.js", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -140,3 +140,3 @@ # openid-client | ||
```js | ||
client.revoke(token) // => Promise | ||
client.revoke(token, [tokenTypeHint]) // => Promise | ||
.then(function (response) { | ||
@@ -149,3 +149,3 @@ console.log('revoked token %s', token, response); | ||
```js | ||
client.introspect(token) // => Promise | ||
client.introspect(token, [tokenTypeHint]) // => Promise | ||
.then(function (response) { | ||
@@ -152,0 +152,0 @@ console.log('token details %j', response); |
40486
767