# CORS error when trying to GET user from Keycloak API

**URL:** <https://forum.keycloak.org/t/cors-error-when-trying-to-get-user-from-keycloak-api/12697>\
**Category:** Getting advice\
**Tags:** account-rest, adapter-javascript, oidc\
**Created:** [December 19, 2021, 3:40pm UTC](https://forum.keycloak.org/t/cors-error-when-trying-to-get-user-from-keycloak-api/12697 "2021-12-19T15:40:32Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![fwitkowski](https://yyz2.discourse-cdn.com/free1/user_avatar/forum.keycloak.org/fwitkowski/32/4632_2.png) [@fwitkowski](https://forum.keycloak.org/u/fwitkowski)\
**Post date:** [December 19, 2021, 3:40pm UTC](https://forum.keycloak.org/t/cors-error-when-trying-to-get-user-from-keycloak-api/12697/1 "2021-12-19T15:40:32Z")

</div>

I’m using Keycloak 16 with Angular through oidc-client-js.

I’m trying to get user data using REST API.  
When I do GET from [http://localhost:8080/auth/realms/ninegold/](http://localhost:8080/auth/realms/ninegold/) I receive 200 with JSON response.

But when trying to get user info: GET [http://localhost:8080/auth/realms/ninegold/users/0e0cf56d-d809-48b0-ac04-bc9dace51be9/](http://localhost:8080/auth/realms/ninegold/users/0e0cf56d-d809-48b0-ac04-bc9dace51be9/) (or any other APIs) I’m getting CORS error

 ![image](https://global.discourse-cdn.com/free1/uploads/keycloak/original/2X/2/25fd491103230e4526224c19d213ab63d3be96c1.png)

---

<div class="post-metadata">

**Author:** ![rahim86](https://avatars.discourse-cdn.com/v4/letter/r/85e7bf/32.png) [@rahim86](https://forum.keycloak.org/u/rahim86)\
**Post date:** [January 18, 2022, 11:49am UTC](https://forum.keycloak.org/t/cors-error-when-trying-to-get-user-from-keycloak-api/12697/2 "2022-01-18T11:49:24Z")

</div>

Update Web origin in Keycloak → Client to \* or update with your host to allow cross origin in Keycloak
