Azure API Management: Automatic Sign-In Issue After Signing Out

hawthorne91 240 Reputation points
2025-01-17T17:21:23.2033333+00:00

In Azure API Management, users are able to log in via Azure AD B2C. However, an issue occurs after they sign out and attempt to log in again. Upon being redirected to the sign-in page and pressing the Azure AD B2C button, users are automatically logged back in without having to re-enter their credentials. What is causing this behavior, and how can it be resolved?

Update: I've tried adding "&prompt=login" to my authorization endpoint in API Management but nothing has come of it. I was also reading the issue from this link (https://github.com/Azure/api-management-developer-portal/issues/1068) however the solutions there do not fit my architecture.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Microsoft Security | Microsoft Entra | Microsoft Entra External ID
Microsoft Security | Microsoft Entra | Microsoft Entra ID
{count} vote

1 answer

Sort by: Most helpful
  1. Anonymous
    2025-01-21T10:13:17.91+00:00

    Hello @hawthorne91,

    We understand that you are facing an issue with Azure AD B2C sign in. Users are able to login back automatically after initial login without having to re-enter their credentials.   

    After reviewing the situation, I would like to suggest a few troubleshooting steps to help resolve the issue:  

    1. Ensure that session behavior is correctly configured in the settings in Azure AD B2C tenant. To adjust the settings, you need to sign in to the Azure portal.  

    If you have access to multiple tenants, select the Settings icon in the top menu to switch to your Azure AD B2C tenant from the Directories + subscriptions menu. 

    Choose All services in the top-left corner of the Azure portal and then search for and select Azure AD B2C.  

    Select User flows (policies).  

    Open the user flow that you previously created.  

    Select Properties.  

    Under Session behavior, you can see Enable keep me signed in session. When you enable the feature, users can opt to stay signed in, so the session remains active after they close the browser.  You can disable the option and check the behavior.  

    Also, make sure that the cookies are cleared upon signing out.   

    Kindly refer the document for more detailed information: https://learn.microsoft.com/en-us/azure/active-directory-b2c/session-behavior?pivots=b2c-user-flow#configure-kmsi-for-a-user-flow

    Hope this helps. Do let us know if you any further queries.

    Thanks & Best Regards,

    Janaki Kota


    If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.


Your answer

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