Skip to content

Multiple instances #1010

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

Merged
merged 18 commits into from
Oct 15, 2019
Merged

Multiple instances #1010

merged 18 commits into from
Oct 15, 2019

Conversation

sameerag
Copy link
Member

@sameerag sameerag commented Sep 24, 2019

This PR is to support multiple instances of MSAL in the same window stack (i.e. in main window and iframe, two separate iframes, etc.).

Changes:

  • Cleaning up the Storage class to make room for future improvements
  • Introducing new functionality to make unique keys in the cache tied to each instance of MSAL
  • Cleaning up the Constants.ts file to properly organize string constants and cache keys
  • Introduction of new Storage mechanics to UserAgentApplication
  • Migration from old cache signatures to new ones
  • Unit tests

Note: @pkanher617 's PR #980 is moved to this PR with some additional changes

@sameerag sameerag changed the base branch from dev to state-keyed-cache October 3, 2019 18:53
@sameerag sameerag changed the base branch from state-keyed-cache to msal-multiple-instances October 3, 2019 21:17
@sameerag sameerag changed the base branch from msal-multiple-instances to dev October 3, 2019 21:17
@sameerag sameerag marked this pull request as ready for review October 4, 2019 08:42
Copy link
Contributor

@jasonnutter jasonnutter left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would like to see a comment added regarding the JSON.parse usage, but otherwise looks good.

@sameerag
Copy link
Member Author

Done. @pkanher617 @jasonnutter Can we please prioritize this tomorrow?

@@ -467,12 +454,11 @@ export class UserAgentApplication {
// Push popup window handle onto stack for tracking
WindowUtils.trackPopup(popUpWindow);
} catch (e) {
this.loginInProgress = false;
this.acquireTokenInProgress = false;
this.cacheStorage.setItem(TemporaryCacheKeys.INTERACTION_STATUS, RequestStatus.CANCELLED);
Copy link
Contributor

@pkanher617 pkanher617 Oct 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does setting to cancelled here do anything? Doesn't this get wiped out anyway during removeAcquireTokenEntries?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Resetting interaction status since we bail out from here with a reject. removeAcquireTokenEntries() checks for this status to remove the entires for a request. So setting this to 'Cancelled' or 'Completed' is necessary.

Copy link
Contributor

@pkanher617 pkanher617 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, would appreciate other eyes on the code.

@sameerag
Copy link
Member Author

@jasonnutter Added the comment. Can you please approve?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants