# Cannot logout from Auth0 - CORS problem - .NET backend

**URL:** <https://community.auth0.com/t/cannot-logout-from-auth0-cors-problem-net-backend/191371>\
**Category:** Get Help\
**Tags:** configuration, application\
**Created:** [September 2, 2025, 8:44am UTC](https://community.auth0.com/t/cannot-logout-from-auth0-cors-problem-net-backend/191371 "2025-09-02T08:44:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ajachocki](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/ajachocki/32/26882_2.png) [@ajachocki](https://community.auth0.com/u/ajachocki)\
**Post date:** [September 2, 2025, 8:44am UTC](https://community.auth0.com/t/cannot-logout-from-auth0-cors-problem-net-backend/191371/1 "2025-09-02T08:44:36Z")

</div>

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

I have pure SPA application at: [https://localhost:7230](https://localhost:7230)

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

No my backend executes that code:

```auto
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:

 ![image](https://global.discourse-cdn.com/auth0/original/3X/a/b/abdeb790edbe0670c10936bfa3e1a1a46b5d651e.png)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/c/2/c26c010c10ea7cf34c1fef52f2587ebce73788c0.png)

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

 ![image](https://global.discourse-cdn.com/auth0/original/3X/2/7/271b299b38cc2099b14a59979991db36c472f8a6.png)

 ![image](https://global.discourse-cdn.com/auth0/original/3X/6/2/62315fd3ca2f1a3a763abe7b061637e354ee86bf.png)

So what’s wrong with that?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [September 5, 2025, 9:25pm UTC](https://community.auth0.com/t/cannot-logout-from-auth0-cors-problem-net-backend/191371/3 "2025-09-05T21:25:39Z")

</div>

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](https://auth0.com/docs/get-started/applications/set-up-cors) regarding the matter and [this](https://auth0.com/blog/cors-tutorial-a-guide-to-cross-origin-resource-sharing/) blog article.

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

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [September 19, 2025, 9:25pm UTC](https://community.auth0.com/t/cannot-logout-from-auth0-cors-problem-net-backend/191371/4 "2025-09-19T21:25:47Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
