Search code examples
angularjsazureadal

Azure AD Logout is not working - Angular SPA


I am using Azure AD authentication for my angular based single page application. Sign in functionality works like a charm and facing issues with the logout. Once the user logged out from the session, its hang on the Azure AD sign out page and not get redirected to the URI given in the post_logout_redirect_uri and allowing users to login without entering credentials again.

Looked for the help over the web and spent almost a week to resolve the issue. But still I didn't find any resolution for this. I came to know that already many users are facing the same issue and no solution provided for the same.

Has anybody faced this issue before and have a solution for the same?


Solution

  • I could able to fix the issue by passing b2c signup/signin policy id in the logout url. Now its get redirected to the desired logout landing page without hanging on Azure AD sign out page.

    https://login.microsoftonline.com/{TENANT}/oauth2/v2.0/logout?p={B2C_SIGNUPIN_POLICY_ID}&post_logout_redirect_uri={APPLICATION_URL}