Static web app Auth0 integration not working

Derek Ruf 6 Reputation points
2023-11-13T15:27:06.51+00:00

I have a Static web app which I am trying to integrate Auth0 authentication into. I have followed all the steps from the Microsoft documentation on how to do so found here:

https://learn.microsoft.com/en-us/azure/static-web-apps/authentication-custom?tabs=openid-connect%2Cinvitations

I added the necessary info to the staticwebapp.config.json file. I have also added all the necessary callback URLs to the auth0 application settings.

"auth": {
        "identityProviders": {
            "customOpenIdConnectProviders": {
                "auth0": {
                    "registration": {
                        "clientIdSettingName": "AUTH0_CLIENT_ID",
                        "clientCredential": {
                            "clientSecretSettingName": "AUTH0_CLIENT_SECRET"
                        },
                        "openIdConnectConfiguration": {
                            "wellKnownOpenIdConfiguration": "https://dev-26y6p72d7lwzkpwp.us.auth0.com/.well-known/openid-configuration"
                        }
                    },
                    "login": {
                        "nameClaimType": "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name",
                        "scopes": ["openid", "profile"]
                    }
                }
            }
        }
    }

When I attempt to login, using this URL (found on the Microsoft documentation)

https://<website>.com/.auth/login/auth0

I get the error

404: Not Found

We couldn’t find that page, please check the URL and try again.

The issue seems to me like it is not a problem with auth0 but with the static web app not properly recognizing the data in the config file and therefore not rerouting the URL to the login URL, but I could be wrong.

Thanks in advance for any guidance.

Azure Static Web Apps
Azure Static Web Apps
An Azure service that provides streamlined full-stack web app development.
957 questions
{count} vote

1 answer

Sort by: Most helpful
  1. SnehaAgrawal-MSFT 21,686 Reputation points
    2024-01-22T09:15:31.22+00:00

    Update- The problem was solved by changing to the Standard plan, because the free hosting plan does not allow custom authentication.

    1 person found this answer helpful.

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.