# Missing CORS Header Problem

**URL:** <https://forum.keycloak.org/t/missing-cors-header-problem/9737>\
**Category:** Getting advice\
**Created:** [June 23, 2021, 5:02pm UTC](https://forum.keycloak.org/t/missing-cors-header-problem/9737 "2021-06-23T17:02:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeonRickert](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/leonrickert/32/3430_2.png) [@LeonRickert](https://forum.keycloak.org/u/LeonRickert)\
**Post date:** [June 23, 2021, 5:02pm UTC](https://forum.keycloak.org/t/missing-cors-header-problem/9737/1 "2021-06-23T17:02:19Z")

</div>

Hi!

I have set up a Jax-rs rest api and a react front-end together with a keycloak server.  
My React App shall make API-Calls and keycloak is supposed to make sure that the user is authenticated.  
The authentication works fine, and the token is assigened to the session, but still if I try to call the api from the react app i get an error in my web console, that the “Access-Control-Allow-Origin” is missing in the Header…

Therefore I started looking for a solution on the internet and until now I set “enable-cors” : true in my keycloak.json file on my rest api-backend. I also wrote a CORS Filter class with the @Provider Annotation.  
 → It still doesnt work and nothing seemed to change until here.

I now read in the keycloak documentation that I am supposed to add a CORS header with a certain config file… This can be found in the “Gatekeeper” chapter of the docs. Where do I find this file?  
In the Doc it says i shall add the following to the file:  
cors-origins:  
-"\*"  
cors-methods:  
-GET  
-POST

Can someone help me please?  
I am very new to this btw, so sorry if I don’t sound very professional here.

Thank you!  
Leon

---

<div class="post-metadata">

**Author:** ![prateek21](https://avatars.discourse-cdn.com/v4/letter/p/ecb155/32.png) [@prateek21](https://forum.keycloak.org/u/prateek21)\
**Post date:** [August 17, 2022, 10:15am UTC](https://forum.keycloak.org/t/missing-cors-header-problem/9737/2 "2022-08-17T10:15:04Z")

</div>

Hello,  
Do you find the solution? I’m stuck with the same problem. Please share the solution if you have.
