Cannot logout from Auth0 - CORS problem - .NET backend

Hi, I have a problem with logging out from Auth0.

I have pure SPA application at: https://localhost:7230

This application, when logging out, posts request to my backend at: https://localhost:7133

No my backend executes that code:

var authenticationProperties = new AuthenticationProperties();
authenticationProperties.RedirectUri = redirectUri.ToString();
authenticationProperties.IsPersistent = true;

return TypedResults.SignOut(authenticationProperties, [CookieAuthenticationDefaults.AuthenticationScheme, config.ChallengeAuthenticationScheme]);

Next I am getting CORS error in Auth0. This is response from preflight:

I have also added my front address to CORS in Auth0 configuration:

So what’s wrong with that?

Hi @ajachocki

I am sorry about the delayed response to your inquiry!

As far as I can see in your request headers, the issue might caused either by the fact that Origin header appears to be null which means it is not properly read or send with the request OR it might be caused by the fact that the Referrer has an extra / and your URL in the Allowed Web Origins does not.

I would recommend double checking your CORS configuration. For extra references, you can check out our documentation regarding the matter and this blog article.

If you continue to experience issue on this matter, let me know!

Kind Regards,
Nik