Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

CORS fails in Blazor WASM even when the server (.NET Core) is allowing everything

$
0
0

We have a CORS problem in Blazor WASM with a server that I think should be allowing everything. We tested Firefox and Edge. The message error in the browser is not too detailed. It only tells us that CORS failed. There is no exception being thrown in the server. It works when the client is in the same machine as the server.

Here is our CORS configuration:

app.UseCors(options => {     options             .AllowCredentials()             .AllowAnyMethod()             .AllowAnyHeader()             .SetIsOriginAllowed(hostName => true);});

Probably the SetIsOriginAllowed line is not allowing all origins as we expected. Previously we had AllowAnyOrigin, but we had to change it after we added AllowCredentials. Is there a way to allow everything, including credentials?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>