# CORS /authorize Problem

**URL:** <https://community.auth0.com/t/cors-authorize-problem/104036>\
**Category:** Get Help\
**Tags:** google-social-connection, connections\
**Created:** [April 3, 2023, 5:00pm UTC](https://community.auth0.com/t/cors-authorize-problem/104036 "2023-04-03T17:00:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dev52](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dev52](https://community.auth0.com/u/dev52)\
**Post date:** [April 3, 2023, 5:00pm UTC](https://community.auth0.com/t/cors-authorize-problem/104036/1 "2023-04-03T17:00:26Z")

</div>

Hey,

I have a web app that makes a request to my backend which builds the url for the auth0 /authorize endpoint and then redirects to it.

I am getting this error  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/f/1/f15dffb3cbdd110d9c4d5300788cffdfd2b58300.png)

I have 2 tenants (one for prod one for dev) and it works in 1 of the tenants and not in the other

I have the backend URL in the allowed origins, also have cors enabled like this:  
 ![image](https://global.discourse-cdn.com/auth0/original/3X/8/d/8d47abbab42a06f59620b4cfbaaa9783f695c575.png)

---

<div class="post-metadata">

**Author:** ![sidathasiri](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/sidathasiri/32/46059_2.png) [@sidathasiri](https://community.auth0.com/u/sidathasiri)\
**Post date:** [April 4, 2023, 10:35am UTC](https://community.auth0.com/t/cors-authorize-problem/104036/2 "2023-04-04T10:35:12Z")

</div>

Try setting the cors like this

```auto
app.use(
  cors({
    credentials: true,
    origin: [
      '<add your url here that sends the request>' //http://localhost:3000
    ],
  })
);

```

---

<div class="post-metadata">

**Author:** ![dev52](https://upload.wikimedia.org/wikipedia/commons/thumb/7/7c/User_font_awesome.svg/768px-User_font_awesome.svg.png) [@dev52](https://community.auth0.com/u/dev52)\
**Post date:** [April 4, 2023, 10:50am UTC](https://community.auth0.com/t/cors-authorize-problem/104036/3 "2023-04-04T10:50:13Z")

</div>

That fixed it looks like.

---

<div class="post-metadata">

**Author:** ![konrad.sopala](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/konrad.sopala/32/13516_2.png) [@konrad.sopala](https://community.auth0.com/u/konrad.sopala)\
**Post date:** [April 4, 2023, 1:04pm UTC](https://community.auth0.com/t/cors-authorize-problem/104036/4 "2023-04-04T13:04:08Z")

</div>

Teamwork makes the dreamwork!

---

<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:** [April 18, 2023, 1:04pm UTC](https://community.auth0.com/t/cors-authorize-problem/104036/5 "2023-04-18T13:04:21Z")

</div>

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