# .Net 6 and No 'Access-Control-Allow-Origin' header is present on the requested resource

**URL:** <https://community.auth0.com/t/net-6-and-no-access-control-allow-origin-header-is-present-on-the-requested-resource/71923>\
**Category:** Get Help\
**Created:** [October 23, 2021, 5:02pm UTC](https://community.auth0.com/t/net-6-and-no-access-control-allow-origin-header-is-present-on-the-requested-resource/71923 "2021-10-23T17:02:16Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![hugodufort](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hugodufort/32/14067_2.png) [@hugodufort](https://community.auth0.com/u/hugodufort)\
**Post date:** [October 23, 2021, 5:02pm UTC](https://community.auth0.com/t/net-6-and-no-access-control-allow-origin-header-is-present-on-the-requested-resource/71923/1 "2021-10-23T17:02:16Z")

</div>

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](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

---

<div class="post-metadata">

**Author:** ![hugodufort](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/hugodufort/32/14067_2.png) [@hugodufort](https://community.auth0.com/u/hugodufort)\
**Post date:** [October 25, 2021, 5:24pm UTC](https://community.auth0.com/t/net-6-and-no-access-control-allow-origin-header-is-present-on-the-requested-resource/71923/2 "2021-10-25T17:24:31Z")

</div>

Ok Git it … For the record

I saw what went wrong in the Auth0 monitoring/Logs It appear that I add the Origin at the wrong Auth0 Application config. Feeling dumm.

---

<div class="post-metadata">

**Author:** ![rueben.tiow](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rueben.tiow/32/11646_2.png) [@rueben.tiow](https://community.auth0.com/u/rueben.tiow)\
**Post date:** [October 25, 2021, 6:47pm UTC](https://community.auth0.com/t/net-6-and-no-access-control-allow-origin-header-is-present-on-the-requested-resource/71923/3 "2021-10-25T18:47:40Z")

</div>

Hi @hugodufort,

I’m happy to hear that you resolved your issue! We’ve all been there.

Thank you for sharing the solution with the rest of the Community!

Have a great rest of your day.

---

<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:** [November 9, 2021, 6:47pm UTC](https://community.auth0.com/t/net-6-and-no-access-control-allow-origin-header-is-present-on-the-requested-resource/71923/5 "2021-11-09T18:47:59Z")

</div>

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