azure ad b2c login page gives 400 bad request

Kalim Shariff 56 Reputation points
2022-02-16T23:06:17.637+00:00

azure ad b2c login page gives 400 bad request after keeping screen idle for the whole night. How can I resolve this issue?

Microsoft Entra External ID
Microsoft Entra External ID
A modern identity solution for securing access to customer, citizen and partner-facing apps and services. It is the converged platform of Azure AD External Identities B2B and B2C. Replaces Azure Active Directory External Identities.
2,713 questions
0 comments No comments
{count} votes

6 answers

Sort by: Most helpful
  1. James Hamil 22,886 Reputation points Microsoft Employee
    2022-02-18T00:13:15.523+00:00

    Hi @Kalim Shariff , this is most likely just due to session/token expiry. Unless I'm misunderstanding. Are you logged in the entire night, and then it logs you out? Or is this just the log in page? Can you just refresh?


  2. Jacek Czarniecki 1 Reputation point
    2022-02-25T09:41:26.497+00:00

    The only solution I see would be to wrap login request with try-catch and handle the error (e.g. auto-reload the page).

    It happened to me (today) and my clients as well (few days ago).

    I was logged in, put device to sleep. Next morning the page shown Session expired (our own code). I reloaded the page to get to login screen but the page is broken. I mean... we plan to handle this 400 response, but it should not happen.

    • there are not details next to "Bad Request". Would be much better to get anything about token expiry.

    177814-b2c-error.png

    177786-b2c-error-2.png

    0 comments No comments

  3. Matt Troutt 1 Reputation point
    2022-07-29T19:22:32.18+00:00

    I'm having this same problem with msal-react. Has anyone discovered a working solution for this?

    0 comments No comments

  4. Rafael Caviquioli 20 Reputation points
    2023-06-26T15:05:15.0633333+00:00

    I have the same error but happening in a different use case.

    1. Open the application and sign in.
    2. Click on sign out, the user is redirected again to the sign in page.
    3. Click on sign in again: SelfAsserted 400
    0 comments No comments

  5. steve 0 Reputation points
    2023-07-20T15:52:16.1766667+00:00

    This happens also if just sitting on the login screen for a long time, on azure's oidc server. This is a UX problem for users who (rightly-so) log out when done, leave the tab open overnight, and the next day try to log in again. Any ideas how to solve? We're using custom policies.

    0 comments No comments