Update- The problem was solved by changing to the Standard plan, because the free hosting plan does not allow custom authentication.
Static web app Auth0 integration not working
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:
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.