Doesn't show the prompt with Select Account

Viewed 103

We use Azure AD B2C tenant and the custom policy. In the custom policy, we prepare 2 ways for sign-in.

  1. Sign-in with the username and password that registered in AD B2C tenant
  2. Sign-in with AAD account

the image is

In sign-in with AAD account, doesn't show the prompt with Select Account, and executes SSO with some kind of account. But which is not the account the user want to sign-in.

How to show the promot with Select Account?

like this

My code is below (masking sensitive parameter)

IPublicClientApplication ClientApp = PublicClientApplicationBuilder.CreateWithApplicationOptions(
    new PublicClientApplicationOptions()
    {
        ClientId = "<Client ID>",
        TicketContainer = KerberosTicketContainer.AccessToken,
    })
    .WithB2CAuthority($"https://{ TenantName }.b2clogin.com/tfp/{ TenantName }/{ CustomPolicySignUpSignIn }")
    .WithRedirectUri($"https://{ TenantName }.b2clogin.com/oauth2/nativeclient")
    .Build();

return await ClientApp.AcquireTokenInteractive(new string[] { $"https://{ TenantName }.onmicrosoft.com/<ID>/XXX.fullaccess" })
    .WithParentActivityOrWindow(new WindowInteropHelper(this).Handle)
    .WithPrompt(Prompt.SelectAccount)
    .ExecuteAsync();

Best regards,

0 Answers
Related