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

Add logoutPopup method to UserAgentApplication #1386

Closed
1 of 5 tasks
arsnyder16 opened this issue Mar 17, 2020 · 2 comments
Closed
1 of 5 tasks

Add logoutPopup method to UserAgentApplication #1386

arsnyder16 opened this issue Mar 17, 2020 · 2 comments
Assignees
Labels
feature Feature requests. msal@1.x Related to msal@1.x (implicit flow)

Comments

@arsnyder16
Copy link

Please follow the issue template below. Failure to do so will result in a delay in answering your question.

Library

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

Description

It would be nice to supply a logoutPopup method. I am building an application that uses MSAL but it's for secondary features and is not critical to the application. So i want to supply my users a way to sign out of MSAL, currently UserAgentApplication only supports signing out through a redirect, but is disruptive to SPA. For now i can manually show a popup but this seems like something that should be part of the library.

const popup = window.open(`${auth.authority}/oauth2/v2.0/logout`, 'logout', 'width=450,height=600');
popup.focus();
@arsnyder16 arsnyder16 added the feature Feature requests. label Mar 17, 2020
@evanbattaglia
Copy link

I am also running into an issue where we show a page to make an MS Teams meeting link in an iframe. The logout() method does not work for us because it takes us to the logout page which sends the X-Frame-Options: Deny header, which disallows the page from being loaded in the iframe.

I've worked around it by borrowing code from the msal module to show the logout in a popup, but it's not pretty. (Also, when I added the postLogoutRedirectUri it didn't seem like I was being redirected back there. The way I have it set up now it's not the end of the world, though).

      //@ts-ignore
      msalApp.clearCache();
      //@ts-ignore
      msalApp.account = null;
      //@ts-ignore
      msalApp.authorityInstance.resolveEndpointsAsync().then(authority => {
        const urlNavigate = authority.EndSessionEndpoint
            ? authority.EndSessionEndpoint
            : `${msalApp.authority}oauth2/v2.0/logout`;
        (msalApp as any).openPopup(urlNavigate, "msal", 400, 600);
      });

@jasonnutter jasonnutter added the msal-browser Related to msal-browser package label Oct 21, 2020
@jasonnutter jasonnutter added msal@1.x Related to msal@1.x (implicit flow) and removed msal-browser Related to msal-browser package labels Nov 9, 2020
@jasonnutter
Copy link
Contributor

Closing, as we will consider this for MSAL Browser in #2563

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature Feature requests. msal@1.x Related to msal@1.x (implicit flow)
Projects
None yet
Development

No branches or pull requests

4 participants