From 6e947bf68888e442a1d99474534e21cc959a43ad Mon Sep 17 00:00:00 2001 From: MichdeJong <126690989+MichdeJong@users.noreply.github.com> Date: Tue, 17 Oct 2023 16:27:41 +0200 Subject: [PATCH] Fix B2C signout (#2224) --- src/routing/aadSignoutRouteGuard.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/routing/aadSignoutRouteGuard.ts b/src/routing/aadSignoutRouteGuard.ts index 6f11c7ef8..1584eacea 100644 --- a/src/routing/aadSignoutRouteGuard.ts +++ b/src/routing/aadSignoutRouteGuard.ts @@ -28,9 +28,13 @@ export class AadSignOutRouteGuard implements RouteGuard { return true; } + const auth = `https://${config.authority}/tfp/${config.signinTenant}/${config.signinPolicyName}`; + const msalConfig = { auth: { clientId: config.clientId, + authority: auth, + knownAuthorities: [config.authority], postLogoutRedirectUri: location.origin } }; @@ -47,8 +51,8 @@ export class AadSignOutRouteGuard implements RouteGuard { this.authenticator.clearAccessToken(); msalInstance.logoutPopup({ - postLogoutRedirectUri: location.origin, - mainWindowRedirectUri: location.origin + postLogoutRedirectUri: location.origin + "/", + mainWindowRedirectUri: location.origin + "/" }); // actual sign-out from AAD/B2C return false; // explicitly stopping route execution.