I am using the @azure/msal-angular version 2 and Angular version 13. The scenario is while calling the logout function the microsoft account signing out the app ( APP A ) successfully. But Ideally other than this app ( APP A ), no other apps which are login already ( Using Microsoft ), should not log out.
( Apps like Microsoft Teams, Outlook, etc... ) These apps are I opened in same browser.
Below code for logout.
let accountId = this.authService.instance.getAllAccounts()[0]?.homeAccountId;
const accountInfoActiveAcc = this.authService.instance.getAccountByHomeId(accountId);
this.authService.logoutPopup({ account: accountInfoActiveAcc });
Please help me to resolve this issue. Thanks in advance.
In the scenario you described, you want to log out from the current app without logging out other apps. To do this, you should set the
mainWindowRedirectUri
parameter to the redirect URI of your app. This will ensure that your app remains logged in, even though the user has logged out from their Microsoft account.Here is an example of how to log out from the current app without logging out other apps:
In my component.ts updated logout as below
Result I opened my Application with Credentials in Localhost
After Logout im able to stay logged other Apps