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 logout to tab-aad-msal2 #173

Open
RobPethick opened this issue Jan 30, 2022 · 1 comment
Open

Add logout to tab-aad-msal2 #173

RobPethick opened this issue Jan 30, 2022 · 1 comment
Assignees

Comments

@RobPethick
Copy link

Sample

tab-aad-msal2

Author(s)

@BobGerman

Suggestion

Could we have a logout button on this app? I'm not quite sure how that flow should work within teams with msal2?

Cheers,
Rob

Are you willing to help?

No

@BobGerman BobGerman self-assigned this Feb 16, 2022
@tiennguyen1293
Copy link

Please using this method.
logoutPopup or logoutRedirect up to your context

    logout() {
        const username = this.getUsername()
        const account = this.msalClient.getAccountByUsername(username)

        if (!account) {
            return false
        }

        try {
            this.msalClient.logoutPopup({
                account,
                postLogoutRedirectUri: postLogoutRedirectUri,
                mainWindowRedirectUri: postLogoutRedirectUri,
                popupWindowAttributes: {
                    popupSize: {
                        height: 535,
                        width: 600
                    },
                }
            });
        }
        catch (err) { console.log(err); }
    }

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

No branches or pull requests

3 participants