# CORS error when using express-openid-connect

**URL:** <https://community.auth0.com/t/cors-error-when-using-express-openid-connect/151469>\
**Category:** Get Help\
**Tags:** express-openid-connect, sdks-quickstarts\
**Created:** [November 13, 2024, 7:51pm UTC](https://community.auth0.com/t/cors-error-when-using-express-openid-connect/151469 "2024-11-13T19:51:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kallurict](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/kallurict/32/62165_2.png) [@kallurict](https://community.auth0.com/u/kallurict)\
**Post date:** [November 13, 2024, 7:51pm UTC](https://community.auth0.com/t/cors-error-when-using-express-openid-connect/151469/1 "2024-11-13T19:51:08Z")

</div>

I’m currently working on implementing an OAuth flow that involves calling a POST API at `http://localhost:3000/authenticate/email`, which subsequently triggers `res.idc.login()`. However, I’m encountering a CORS error when the request redirects to Auth0 at `https://dev-1nyx62hlgk6gdsyg.us.auth0.com/authorize` with the necessary parameters for authentication, including the client ID, scopes, response type, and redirect URI. I’ve already added several entries to the allowed web origins in Auth0 settings, including `http://localhost:3000`, `http://localhost:3000/authenticate/email`, `http://localhost:3000/api/logout`, `http://localhost:3000/login`, and `http://localhost:3000/callback`. Despite these settings, the CORS error persists. I’m wondering if there’s an additional configuration or URL that needs to be whitelisted to resolve this issue.

---

<div class="post-metadata">

**Author:** ![marybeth.hunter](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/marybeth.hunter/32/61955_2.png) [@marybeth.hunter](https://community.auth0.com/u/marybeth.hunter)\
**Post date:** [November 13, 2024, 10:55pm UTC](https://community.auth0.com/t/cors-error-when-using-express-openid-connect/151469/2 "2024-11-13T22:55:17Z")

</div>

Hi @kallurict,

Welcome to the Auth0 Community!

I understand that you are seeing a CORS error after a redirect - I believe you may be running into one of the issues mentioned in this Community Article: [CORS error when initiating silent auth requests](https://community.auth0.com/t/cors-error-when-initiating-silent-auth-requests/103208)

Could you please review that article, and check how the redirection is being made by your application? The user’s browser should be navigating to the `/authorize` URL and not a Javacscript fetch/request.

If you are still having issues, some code snippets of how your application is triggering the redirect would be helpful for further troubleshooting.

Best,

Mary Beth

---

<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 27, 2024, 10:55pm UTC](https://community.auth0.com/t/cors-error-when-using-express-openid-connect/151469/3 "2024-11-27T22:55:41Z")

</div>

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