Hi there,
I’m working on a project where I implemented Auth0 authentication, and I’ve been able to do it correctly. This project is based on .Net 6 / WASM.
Login, Token Request, Call my C# API with that token. All go well.
My .Net API CORS config actually allow AnyOrigins, AnyHeader, …
But I went into an issue that I can’t find a solution for.
I Upload my SQL Database, C# API and Blazor App to Azure. The database and backend are working well, but I’m facing a issue when requesting the Token from the Blazor App when hosted on Azure.
Here the complete message
Access to fetch at 'https://dev-xxxxxxxx.us.auth0.com/oauth/token' from origin 'https://xxxxxxxx.azurewebsites.net' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
But when configure my Blazor App to connect to my azure host API work well, I mean the API return me the data request.
I only get Access-Control-Allow-Origin error when I try to run my app from Azure.
I’ve added the https://xxxxxxxx.azurewebsites.net’ the the Auth0 app config.
-
Allowed Web Origins
-
Allowed Origins (CORS)
Is there something that I miss?
Is there a bug in Auth0 related to .Net 6?
Thanks Hugo