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

Expose the full AuthResponse details #107

Merged
merged 14 commits into from
Jul 25, 2019
Merged

Conversation

AndrewCraswell
Copy link
Contributor

@AndrewCraswell AndrewCraswell commented Jul 19, 2019

Purpose

Currently we only expose the Account info when authentication completes. This is not sufficient because, for example, this would not give access to the state data which is needed for many security scenarios. The full authentication details are exposed by msal using the AuthResponse, and we should be returning this data and storing in Redux.

Does this introduce a breaking change?

[ ] Yes
[x] No

Pull Request Type

What kind of change does this Pull Request introduce?

[ ] Bugfix
[x] Feature
[ ] Code style update (formatting, local variables)
[ ] Refactoring (no functional changes, no api changes)
[x] Documentation content changes
[ ] Other... Please describe:

How to Test

  • Get the code
  • Run the sample app and verify the AuthResponse is saved in the Redux store as authenticationResponse using the React DevTools extension.

@AndrewCraswell
Copy link
Contributor Author

My team hit a blocker where we need to be able to access some of the data in the AuthResponse in order to implement a feature. I hadn't realized that we weren't exposing that after authentication, so this PR remedies that. It also actually simplifies the code a bit.

We have a demo with our CVP early next week so I was hoping to get this in by the weekend if at all possible.

jwtIdToken: idToken,
account: authResponse.account,
authenticationResponse: authResponse,
jwtAccessToken: authResponse.accessToken,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

All of the token data and account info already exists in the AuthResponse object, but I've elected to keep the previous values to prevent breaking changes.

Copy link
Contributor

@omusavi omusavi left a comment

Choose a reason for hiding this comment

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

:shipit:

@AndrewCraswell AndrewCraswell merged commit 550647b into master Jul 25, 2019
@AndrewCraswell AndrewCraswell deleted the andcra/auth-response branch July 26, 2019 13:59
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.

None yet

3 participants