Getting SSO AADB2C90091 - The+user+has+cancelled+entering+self-asserted+information in aspx page

Hasan Sabbuba 0 Reputation points
2023-11-28T20:15:07.29+00:00

In the callback.aspx page, the authenticating portion works correctly from incoming email from Azure AD B2C. However, if I hit cancel in the SSO page after clicking forget password, the code code to the Callback.aspx where I am handling the request.

else if (!string.IsNullOrEmpty(Request.QueryString["error"]))
{
    
    if (!string.IsNullOrEmpty(Request.QueryString["error_description"]))
    {

        log.DebugFormat("AAD B2C Login - error: {0}", Request.QueryString["error_description"]);

        if (Request.QueryString["error_description"].Contains("AADB2C90091"))
        {
          
                 Response.Redirect($"{redirect_noauth_uri}"); // SSO page page
               
        }

    }
    
}

Normally, the code should redirect the URI to the SSO page, but it is not doing it. As if there is a wrapper somewhere is throwing the yellow page and stays on the same Callbackpage.aspx. I tried to manipulate all the properties un AD B2C, but not successful so far. Same issue happens when using UserFlow.

Any idea why it is not redirecting to any page my response.

Thank you,

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
18,740 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Shweta Mathur 25,566 Reputation points Microsoft Employee
    2023-11-29T06:36:57.3566667+00:00

    Hi @Hasan Sabbuba ,

    Thanks for reaching out.

    This is the expected behavior when the user hits ‘Cancel’ button Azure AD B2C will return an error response with Error Code -AADB2C90091 so that application can catch this error code and redirect to other page i.e signIn or signOut page.

    The way to handle this error is to either catch them in your application or hide the cancel button using java script or CSS file.

    Hope this will help.

    Thanks,

    Shweta


    Please remember to "Accept Answer" if answer helped you.