@sagar nayak Thanks for asking question!
It seems like you are having trouble configuring SWA custom authentication on your React app. I'll do my best to help you out.
Based on the information you provided, it looks like you have configured SWA with staticwebapp.config.json for custom authentication using Auth0, but you are getting a 404 error when you try to access /.auth/login/auth0.
Check this example of what your staticwebapp.config.json file should look like:
{
"routes": [
{
"route": "/*",
"serve": "/index.html",
"statusCode": 200
},
{
"route": "/.auth/login/auth0",
"allowedRoles": ["anonymous"],
"authLevel": "anonymous"
}
],
"authentication": {
"routeLogin": "/.auth/login/auth0",
"routeLogout": "/.auth/logout",
"login": {
"provider": "auth0",
"clientId": "<your-auth0-client-id>",
"clientSecret": "<your-auth0-client-secret>",
"domain": "<your-auth0-domain>",
"audience": "<your-auth0-audience>"
}
}
}
Make sure to replace the placeholders with your own Auth0 client ID, client secret, domain, and audience.
Also, make sure that you have followed the steps in the Azure Static Web Apps documentation to configure Auth0 as your authentication provider.
You can find the documentation here: https://docs.microsoft.com/en-us/azure/static-web-apps/authentication-authorization#configure-authentication-providers
If you have followed all the steps correctly and are still experiencing issues, you can try enabling logging in your Azure Static Web App.
https://learn.microsoft.com/en-us/azure/static-web-apps/apis-functions#troubleshooting-and-logs
I hope this helps! Let me know if you have any further questions.