Static webapp problem - No reply address provided

Niklas Åsberg 0 Reputation points
2024-12-19T15:14:55.9533333+00:00

I am hosting an Angular Single Page Application (SPA) on Azure Static Web Apps, and I am trying to enable Azure Active Directory (AAD) authentication for the front-end. Despite configuring the app registration and Azure Static Web App settings, authentication fails, and users are unable to log in.
User's image

Details

  1. Application Overview
  • Front-end: Angular SPA hosted on Azure Static Web Apps.
  • Backend APIs: Accessed via separate services (currently not secured; only front-end authentication is being implemented).
  • Authentication Provider: Azure Active Directory (AAD).
  1. Steps Taken
  • Created an Azure AD App Registration for the SPA.
  • Configured Redirect URIs for the SPA under Single Page Application:
    • https://mc-app-tst.lantmannen.com/.auth/login/aad/callback
    • https://mc-app-test.azcn.lantmannen.com/.auth/login/aad/callback

User's image

User's image

  • Updated the staticwebapp.config.json file to enforce authentication with the following configuration:

{

"routes": [

    {

        "route": "/*",

        "allowedRoles": [

            "authenticated"

        ]

    }

],

"responseOverrides": {

    "401": {

        "redirect": "/.auth/login/aad",

        "statusCode": 302

    }

},

"auth": {

    "identityProviders": {

        "azureActiveDirectory": {

            "registration": {

                "openIdIssuer": "https://login.microsoftonline.com/
Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
1,036 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 22,006 Reputation points
    2024-12-23T12:16:39.5+00:00

    @Niklas Åsberg Thanks for reaching here! Could you make sure your route rules don't conflict with your selected authentication providers. Blocking a provider with a route rule prevents users from accepting invitations.

    For more information on how to configure Microsoft Entra ID, see the App Service Authentication/Authorization documentation on using an existing registration.

    To configure which accounts can sign in, see Modify the accounts supported by an application and Restrict your Microsoft Entra app to a set of users in a Microsoft Entra tenant.

    Also suggest you to refer to the authentication and authorization section.

    0 comments No comments

Your answer

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