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

PublicClientApplication.logout should be able to log the user out without interaction #3286

Closed
1 of 10 tasks
k-mehta opened this issue Mar 23, 2021 · 1 comment · Fixed by #3044
Closed
1 of 10 tasks
Labels
feature Feature requests. msal-browser Related to msal-browser package

Comments

@k-mehta
Copy link

k-mehta commented Mar 23, 2021

Library

  • msal@1.x.x or @azure/msal@1.x.x
  • @azure/msal-browser@2.12.1
  • @azure/msal-node@1.x.x
  • @azure/msal-react@1.x.x
  • @azure/msal-angular@0.x.x
  • @azure/msal-angular@1.x.x
  • @azure/msal-angular@2.x.x
  • @azure/msal-angularjs@1.x.x

Description

When the logout function is called, the user is redirected to a page which asks them to select which account they want to log out of. They have to make a selection even if they're only logged in to one account. I tried giving the logout function an EndSessionRequest object with the account parameter populated but that doesn't bypass the account selection either. It'd be a cleaner user experience if the user didn't have to take this seemingly unnecessary extra step.

Source

    const logoutRequest: EndSessionRequest = { account };
    await msalApplication.current.logout(logoutRequest);
  • Internal (Microsoft)
  • Customer request
@k-mehta k-mehta added the feature Feature requests. label Mar 23, 2021
@github-actions github-actions bot added the msal-browser Related to msal-browser package label Mar 23, 2021
@tnorling
Copy link
Collaborator

tnorling commented Mar 23, 2021

@k-mehta The account object you provide to the logout function is used to clear local cache, it is not used to tell the server who to sign out. In order to sign the user out on the server the redirect to the sign-out screen is required. Without this redirect your user could sign back into your application without providing credentials again as their server session would remain active. There is currently no way to bypass the account selection screen and this is not something MSAL controls. We've heard this feedback before and we've passed it along to the server team but it's ultimately their decision whether or not they'll pick it up.

If you don't care about signing the user out of the server you can pass a callback that returns false to onRedirectNavigate on the logout request. This will skip the redirect to the server but will leave the server session active.

Documentation around this will be updated in #3044 to clarify why this is required and the workaround described above.

@tnorling tnorling linked a pull request Mar 24, 2021 that will close this issue
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests. msal-browser Related to msal-browser package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants