Skip to content

Expose the full AuthResponse details - #107

Merged
AndrewCraswell merged 14 commits into
masterfrom
andcra/auth-response
Jul 25, 2019
Merged

AndrewCraswell merged 14 commits into
masterfrom
andcra/auth-response

Conversation

@AndrewCraswell

@AndrewCraswell AndrewCraswell commented Jul 19, 2019 •

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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.

Comment thread src/MsalAuthProvider.ts Resolved
Comment thread src/MsalAuthProvider.ts
jwtIdToken: idToken,
account: authResponse.account,
authenticationResponse: authResponse,
jwtAccessToken: authResponse.accessToken,

Copy link
Copy Markdown
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.

@omusavi omusavi left a comment

Copy link
Copy Markdown
Contributor

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.

3 participants