oidc-client
Advanced tools
Comparing version 1.11.3 to 1.11.4
{ | ||
"name": "oidc-client", | ||
"version": "1.11.3", | ||
"version": "1.11.4", | ||
"description": "OpenID Connect (OIDC) & OAuth2 client library", | ||
@@ -5,0 +5,0 @@ "main": "lib/oidc-client.min.js", |
@@ -18,3 +18,2 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. | ||
this._jsonService = new JsonServiceCtor(['application/jwk-set+json']); | ||
this._metadata_promise; | ||
} | ||
@@ -48,4 +47,3 @@ | ||
getMetadata() { | ||
// metadata was preloaded and no url was provided, so use the supplied data. | ||
if (!this.metadataUrl && this._settings.metadata) { | ||
if (this._settings.metadata) { | ||
Log.debug("MetadataService.getMetadata: Returning metadata from settings"); | ||
@@ -55,3 +53,2 @@ return Promise.resolve(this._settings.metadata); | ||
// no url was provided and settings were not pre-loaded then throw an error. | ||
if (!this.metadataUrl) { | ||
@@ -62,23 +59,14 @@ Log.error("MetadataService.getMetadata: No authority or metadataUrl configured on settings"); | ||
// if we've already started fetching metadata return the existing promise so we don't call it again. | ||
if (this._metadata_promise) { | ||
Log.debug("MetadataService.getMetadata: getting metadata from cache promise", this.metadataUrl); | ||
return this._metadata_promise | ||
} | ||
Log.debug("MetadataService.getMetadata: getting metadata from", this.metadataUrl); | ||
this._metadata_promise = this._jsonService.getJson(this.metadataUrl) | ||
return this._jsonService.getJson(this.metadataUrl) | ||
.then(metadata => { | ||
Log.debug("MetadataService.getMetadata: json received"); | ||
// overlay .well-known/openid-configuration over seeded setting. this allows consumers to set values | ||
// like end_session_url for Auth0 when it is not available in the configuration endpoint. | ||
// precedence was set on the assumption the issuers hosted configuration is always more accurate | ||
// than what the developer seeded the client with. | ||
if (!this._settings.metadata) this._settings.metadata = {} | ||
Object.assign(this._settings.metadata, metadata); | ||
return this._settings.metadata; | ||
var mergedMetadata = this._settings.metadataSeed || {}; | ||
Object.assign(mergedMetadata, metadata); | ||
this._settings.metadata = mergedMetadata; | ||
return metadata; | ||
}); | ||
return this._metadata_promise; | ||
} | ||
@@ -85,0 +73,0 @@ |
@@ -21,3 +21,3 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. | ||
// metadata related | ||
authority, metadataUrl, metadata, signingKeys, | ||
authority, metadataUrl, metadata, signingKeys, metadataSeed, | ||
// client related | ||
@@ -48,2 +48,3 @@ client_id, client_secret, response_type = DefaultResponseType, scope = DefaultScope, | ||
this._metadata = metadata; | ||
this._metadataSeed = metadataSeed; | ||
this._signingKeys = signingKeys; | ||
@@ -177,2 +178,8 @@ | ||
} | ||
get metadataSeed() { | ||
return this._metadataSeed; | ||
} | ||
set metadataSeed(value) { | ||
this._metadataSeed = value; | ||
} | ||
@@ -179,0 +186,0 @@ get signingKeys() { |
@@ -1,1 +0,1 @@ | ||
const Version = "1.11.3"; export {Version}; | ||
const Version = "1.11.4"; export {Version}; |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
19428971
70563