# No 'Access-Control-Allow-Origin' header is present on the requested resource in Keycloak 21

**URL:** <https://forum.keycloak.org/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource-in-keycloak-21/22539>\
**Category:** Miscellanaeous\
**Created:** [June 7, 2023, 11:49am UTC](https://forum.keycloak.org/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource-in-keycloak-21/22539 "2023-06-07T11:49:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![rcbandit](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/rcbandit/32/7189_2.png) [@rcbandit](https://forum.keycloak.org/u/rcbandit)\
**Post date:** [June 7, 2023, 11:49am UTC](https://forum.keycloak.org/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource-in-keycloak-21/22539/1 "2023-06-07T11:49:14Z")

</div>

I’m trying to configure React app to work with Keycloak 21 and Spring Boot gateway. When I open remotely hosted React page and page a GET request I get error into browser:

```
Access to XMLHttpRequest at 'https://ip/realms/admin_console_realm/protocol/openid-connect/auth?response_type=code&client_id=admin_console_client&scope=openid&state=ze9ujRxcOaI9PhgKXozIsGd0VDCnjXSF9-u_t_8bXA0%3D&redirect_uri=http://ip/login/oauth2/code/keycloak&nonce=O9rOLQ0HH-eHZFi76hW08w2r3aCmn2Enm8df68HQvBA' (redirected from 'https://ip/api/microservice/dashboard/test') from origin 'https://xxxxxxx-xi.vercel.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

```

Unfortunately all solutions on Google are for old version of Keycloak. Do you know into the latest version any working solution?

---

<div class="post-metadata">

**Author:** ![zeppelinux](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zeppelinux/32/1876_2.png) [@zeppelinux](https://forum.keycloak.org/u/zeppelinux)\
**Post date:** [June 14, 2023, 8:59pm UTC](https://forum.keycloak.org/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource-in-keycloak-21/22539/2 "2023-06-14T20:59:26Z")

</div>

I’m having problems with Ajax requests as well, here is the discussion [How to make sure Ajax re-authentication requests not to fail on CORS? · keycloak/keycloak · Discussion #20910 · GitHub](https://github.com/keycloak/keycloak/discussions/20910)

---

<div class="post-metadata">

**Author:** ![Mcvetic](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/mcvetic/32/9761_2.png) [@Mcvetic](https://forum.keycloak.org/u/Mcvetic)\
**Post date:** [February 12, 2024, 11:06pm UTC](https://forum.keycloak.org/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource-in-keycloak-21/22539/3 "2024-02-12T23:06:18Z")

</div>

> [@zeppelinux](#):
>
> with Ajax requests as well, here is the discu

I have the same issue? Any know the solution?

---

<div class="post-metadata">

**Author:** ![zeppelinux](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/zeppelinux/32/1876_2.png) [@zeppelinux](https://forum.keycloak.org/u/zeppelinux)\
**Post date:** [February 12, 2024, 11:56pm UTC](https://forum.keycloak.org/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource-in-keycloak-21/22539/4 "2024-02-12T23:56:40Z")

</div>

Discussion in Quarkus users group [https://groups.google.com/g/quarkus-dev/c/dtSHSp0-ThY/m/QeVIVbAdBAAJ](https://groups.google.com/g/quarkus-dev/c/dtSHSp0-ThY/m/QeVIVbAdBAAJ)

---

<div class="post-metadata">

**Author:** ![outwringing](https://avatars.discourse-cdn.com/v4/letter/o/c67d28/32.png) [@outwringing](https://forum.keycloak.org/u/outwringing)\
**Post date:** [April 22, 2024, 7:50pm UTC](https://forum.keycloak.org/t/no-access-control-allow-origin-header-is-present-on-the-requested-resource-in-keycloak-21/22539/5 "2024-04-22T19:50:28Z")

</div>

Hi everyone, I have the same issue.  
Is possible to force set the “Access-Control-Allow-Origin” header on the Keycloak side?
