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

[msal-browser] Add support for logout_hint #4450

Merged
merged 10 commits into from Jan 29, 2022
Merged

[msal-browser] Add support for logout_hint #4450

merged 10 commits into from Jan 29, 2022

Conversation

hectormmg
Copy link
Member

@hectormmg hectormmg commented Jan 26, 2022

This PR:

  • Adds logoutHint attribute to CommonEndSessionRequest type
  • Adds logic in StandardInteractionClient.initializeLogoutRequest to parse login_hint from ID token claims in the account (if) passed in and set it as logout_hint in the end session request
  • Adds addLogoutHint API to RequestParameterBuilder and calls it on AuthorizationCodeClient.getLogoutUri() to populate the logout_hint query parameter of the end session endpoint request
  • Adds unit tests that cover these changes and scenarios

@github-actions github-actions bot added msal-browser Related to msal-browser package msal-common Related to msal-common package labels Jan 26, 2022
@codecov-commenter
Copy link

codecov-commenter commented Jan 26, 2022

Codecov Report

Merging #4450 (398cf98) into dev (dc27ea9) will increase coverage by 0.90%.
The diff coverage is 84.00%.

Flag Coverage Δ
msal-angular 96.39% <ø> (ø)
msal-browser 87.51% <89.47%> (+<0.01%) ⬆️
msal-common 85.32% <66.66%> (-0.05%) ⬇️
msal-core ?
msal-node 82.97% <ø> (ø)
msal-node-extensions 76.03% <ø> (ø)
msal-react 92.70% <ø> (ø)
Impacted Files Coverage Δ
.../msal-common/src/client/AuthorizationCodeClient.ts 77.60% <0.00%> (-0.82%) ⬇️
...rc/interaction_client/StandardInteractionClient.ts 97.19% <89.47%> (-1.69%) ⬇️
...msal-common/src/request/RequestParameterBuilder.ts 92.68% <100.00%> (+0.12%) ⬆️
lib/msal-common/src/utils/Constants.ts 100.00% <100.00%> (ø)
lib/msal-core/src/ScopeSet.ts
lib/msal-core/src/utils/TimeUtils.ts
lib/msal-core/src/utils/ResponseUtils.ts
lib/msal-core/src/authority/AuthorityFactory.ts
...sal-core/src/error/InteractionRequiredAuthError.ts
lib/msal-core/src/authority/TrustedAuthority.ts
... and 39 more

@hectormmg hectormmg linked an issue Jan 28, 2022 that may be closed by this pull request
@github-actions github-actions bot added the documentation Related to documentation. label Jan 28, 2022
@hectormmg hectormmg marked this pull request as ready for review January 28, 2022 21:45
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.

This looks great!

@hectormmg hectormmg merged commit 4c7418a into dev Jan 29, 2022
@hectormmg hectormmg deleted the logout-hint branch January 29, 2022 00:47
azure-pipelines bot pushed a commit that referenced this pull request Feb 7, 2022
* Add loginHint attribute to End Session Request types

* Add support for logout_hint for logout APIs in msal-browser

* Replace preferred_username with login_hint ID token claim for logout_hint behavior

* Add promptless logout docs

* Change files

* Update tests tpush origin logout-hint

* Remove localization from MS docs link on login_hint optional claim

Co-authored-by: Jason Nutter <janutter@microsoft.com>

Co-authored-by: Jason Nutter <janutter@microsoft.com>
azure-pipelines bot pushed a commit that referenced this pull request Feb 7, 2022
* Add loginHint attribute to End Session Request types

* Add support for logout_hint for logout APIs in msal-browser

* Replace preferred_username with login_hint ID token claim for logout_hint behavior

* Add promptless logout docs

* Change files

* Update tests tpush origin logout-hint

* Remove localization from MS docs link on login_hint optional claim

Co-authored-by: Jason Nutter <janutter@microsoft.com>

Co-authored-by: Jason Nutter <janutter@microsoft.com>
@ghost
Copy link

ghost commented Feb 8, 2022

🎉@azure/msal-common@v6.1.0 has been released which incorporates this pull request.:tada:

We recommend upgrading to the latest version of @azure/msal-browser or @azure/msal-node to take advantage of this change.

Handy links:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Related to documentation. msal-browser Related to msal-browser package msal-common Related to msal-common package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Silent logout, login without cache token
5 participants