Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the endpoints.api config value when generating the url on login #106

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/adal.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,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
Expand Down Expand Up @@ -508,6 +508,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);
Expand Down Expand Up @@ -585,6 +587,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);
Expand Down Expand Up @@ -666,6 +669,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
Expand Down