Azure AD B2C integration with Azure AD enable to s

2019-08-02 04:18发布

问题:

I have Azure AD B2C where two identity providers Google and Azure AD. Also I have custom policy to login made by this manual. When I click on Google login button in my app, there is a choice of accounts, or I can select to login in new account. But when I select Azure AD provider, then I silently login into my app without any prompt. (The only way to change account is to clear cache of Chrome on my mobile device)

Is it possible to make in custom policy for login in Azure AD enable 'Login as other user' or not?

回答1:

I faced the same issue and I fixed it by adding below code in Configure method for OpenIdConnectOptions

options.Events = new OpenIdConnectEvents
 {

    ...
    OnRedirectToIdentityProvider = async (context) =>
    {
      context.ProtocolMessage.Prompt = "select_account";
    }
 };

Can you share your Startup.cs file?