From 915f5b0d9f4f62551c70e9772f97043bbcbd7f28 Mon Sep 17 00:00:00 2001 From: Noam Kfir Date: Tue, 11 Feb 2020 14:41:29 +0200 Subject: [PATCH 1/2] Add endpoints api to login url --- src/adal.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/adal.js b/src/adal.js index b2cfdce..74f87e2 100644 --- a/src/adal.js +++ b/src/adal.js @@ -228,7 +228,7 @@ var AuthenticationContext = (function () { this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN, this._idTokenNonce, true); this._saveItem(this.CONSTANTS.STORAGE.ERROR, ''); this._saveItem(this.CONSTANTS.STORAGE.ERROR_DESCRIPTION, ''); - var urlNavigate = this._getNavigateUrl('id_token', null) + '&nonce=' + encodeURIComponent(this._idTokenNonce); + var urlNavigate = this._getNavigateUrl('id_token', this.config.endpoints.api) + '&nonce=' + encodeURIComponent(this._idTokenNonce); if (this.config.displayCall) { // User defined way of handling the navigation From 6b77f3eab948d9d42a2767a8e46a453d70583a49 Mon Sep 17 00:00:00 2001 From: Noam Kfir Date: Tue, 11 Feb 2020 14:46:39 +0200 Subject: [PATCH 2/2] Add some verbose debug messages --- src/adal.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/adal.js b/src/adal.js index 74f87e2..9f5606a 100644 --- a/src/adal.js +++ b/src/adal.js @@ -504,6 +504,8 @@ var AuthenticationContext = (function () { var urlNavigate = this._urlRemoveQueryStringParameter(this._getNavigateUrl(responseType, resource), 'prompt'); if (responseType === this.RESPONSE_TYPE.ID_TOKEN_TOKEN) { + this.verbose('ID TOKEN TOKEN'); + this.verbose('Response Type : ' + responseType); this._idTokenNonce = this._guid(); this._saveItem(this.CONSTANTS.STORAGE.NONCE_IDTOKEN, this._idTokenNonce, true); urlNavigate += '&nonce=' + encodeURIComponent(this._idTokenNonce); @@ -581,6 +583,7 @@ var AuthenticationContext = (function () { */ AuthenticationContext.prototype._loadFrameTimeout = function (urlNavigation, frameName, resource) { //set iframe session to pending + this.verbose(urlNavigation); this.verbose('Set loading state to pending for: ' + resource); this._saveItem(this.CONSTANTS.STORAGE.RENEW_STATUS + resource, this.CONSTANTS.TOKEN_RENEW_STATUS_IN_PROGRESS); this._loadFrame(urlNavigation, frameName); @@ -662,6 +665,9 @@ var AuthenticationContext = (function () { this.registerCallback(this._activeRenewals[resource], resource, callback); } else { + this.verbose('INFORMATION'); + this.verbose(JSON.stringify(this._user)); + this.verbose(resource); this._requestType = this.REQUEST_TYPE.RENEW_TOKEN; if (resource === this.config.clientId) { // App uses idtoken to send to api endpoints