Azure AD B2C: Custom Policy - How to signout a user during profile update user journey?

Prudhvi Keertipati 1 Reputation point
2022-10-11T17:18:48.293+00:00

Hi,

I have a requirement to sign-out (or kill user session) a user if a particular claim is changed in profile update policy. Is there is any way to trigger a sign-out during profile update journey?

Thanks.

Microsoft Security | Microsoft Entra | Microsoft Entra External ID
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. James Hamil 27,221 Reputation points Microsoft Employee Moderator
    2022-10-11T19:28:33.527+00:00

    Hi @Prudhvi Keertipati ,this thread details how you can do this:

    "Unfortunately there's no default sign out flow for B2C, but you can workaround this by redirecting your app to do a sign out.

    You can redirect the users to redirect the user to the end_session endpoint that is listed in the OpenID Connect metadata document.

    Like for Tenant : Fabrikamb2c.com the metadata would be at https://fabrikamb2c.b2clogin.com/fabrikamb2c.onmicrosoft.com/b2c_1_sign_in/v2.0/.well-known/openid-configuration

    You can then select the end_session_endpoint URL. something like this : GET https://{tenant}.b2clogin.com/{tenant}.onmicrosoft.com/{policy}/oauth2/v2.0/logout?post_logout_redirect_uri=https%3A%2F%2Fjwt.ms%2F]

    If you use the post_logout_redirect_uri parameter (optional), the user would be redirected to that URL after a successful sign out. It can be a custom URL for your Webpage. Unless you provide an id_token_hint, you should not register this URL as a reply URL in your Azure AD B2C application settings.

    You can read the sign out process here."

    The linked thread has some other replies you can take a look at as well. Please let me know if this helps. If not I can help you further.

    Thank you,
    James

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.