404 Error on B2C login callback

Graham Allwood 306 Reputation points
2021-04-30T13:13:42.407+00:00

Hi,

I have a SPA application using Azure B2C. When popups are allowed, I get a dialog box for authentication (my user flow). On success, the browser window closes and my redirect on my main app works ok.

If I now block pop ups. Authentication is now done in a new page, not browser window. However, on pressing Login, the redirect goes to my app but my app now shows a 404 error.

I'm using Blazor wasm.

Some more info.

If I run my app local (IIS Express), everything works ok. If I run my app in Azure static web site the error happens. N.B. I have two different allowed redirect urls on my B2C client application.

Has anyone seen this before, where the popup blocker is causing this error?

Thanks for any help.

Graham

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,663 questions
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
770 questions
{count} vote

2 answers

Sort by: Most helpful
  1. Abhishek Khanna 6 Reputation points
    2021-12-07T15:16:42.47+00:00

    Yes, I am able to deploy Blazor web assembly with ADB2C on Azure Static Web Apps.

    What I was missing was a StaticWebApp.config.json file in the root folder of my Blazor project with the following contents:

    {
      "navigationFallback": {
        "rewrite": "/index.html"
      }
    }
    

    Once I added this file, the 404 error went away.

    1 person found this answer helpful.
    0 comments No comments

  2. Abhishek Khanna 6 Reputation points
    2021-12-07T15:18:13.273+00:00

    Kindly refer to the following link for additional information:

    https://learn.microsoft.com/en-us/azure/static-web-apps/deploy-blazor

    0 comments No comments