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

Adding IdToken claims to MSAL JS interfaces : AuthResponse and Account #804

Merged
merged 6 commits into from
Jul 11, 2019

Conversation

sameerag
Copy link
Member

@sameerag sameerag commented Jul 3, 2019

This PR:

  • adds all the claims in an id_token in the API surface for the developer reference; idToken in 'Account' is to map a request to the corresponding session. This PR deprecates the current parameter 'idToken' in the 'Account' class and adds a more meaningful parameter: 'idTokenClaims'. Since both are same, for backward compatibility until 1.1.0, both the parameters are supported.
  • adds 'idTokenClaims' in response to map the claims within a request-response cycle.
  • remove dependency on response.idToken in UserAgentApplication code.

Relevant changes:

  • Corresponding changes in response in UserAgentApplication
  • Unit tests added for claims; more enhancement in UserAgentApplication test cases
  • Unit tests added for IdToken and Account classes

Todo:

  • Documentation changes needed for the Surface changes will be edited in the Readme once this PR is ready to be Merged.
  • Today we have two different data types for IdToken and AccessToken. Ideally, both should have been tokens (JWT format as referenced in Microsoft AAD docs). Since this is a breaking change, we are preserving the IdToken type in the response for this PR but will track this in the future major release.

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.

LGTM.

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.

One comment otherwise looks good!

lib/msal-core/src/MsalTypes.ts Outdated Show resolved Hide resolved
@sameerag sameerag merged commit 96be557 into dev Jul 11, 2019
@sameerag sameerag deleted the idToken_claims branch July 30, 2019 20:01
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.

4 participants