Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORS error with 26.0.6 when hostname and hostname_admin are different #62

Open
olivier34000 opened this issue Nov 26, 2024 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@olivier34000
Copy link

Hello,

I updated the container from 25.0.6.1729619380 to 26.0.6.1732296619 and now in the admin area of Keycloak when I click on Organizations I have a cors issue CORS error fetch useOrgFetcher.ts:30

The variables KC_HOSTNAME and KC_HOSTNAME_ADMIN are different. I tried to keep the old variables KC_HOSTNAME_URL and KC_HOSTNAME_ADMIN_URL but it doesn't work.
The request on /realms/master/orgs?first=0&max=11 is executed on KC_HOSTNAME instead of KC_HOSTNAME_ADMIN

Could you check ?

@xgp
Copy link
Member

xgp commented Nov 26, 2024

@pnzrr There is a change because of the "hostname v2" update. Can you check to make sure we are honoring the new variable names when constructing the orgs API urls? https://www.keycloak.org/server/all-config#category-hostname_v2

@xgp xgp added the bug Something isn't working label Nov 26, 2024
@xgp xgp assigned xgp and pnzrr and unassigned xgp Nov 26, 2024
@pnzrr
Copy link

pnzrr commented Nov 26, 2024

@xgp this is currently set with:

const authUrl = environment.serverBaseUrl;

so I can try to adjust using the newer

const authUrl = environment.adminBaseUrl;

and hope that will pick up the right url.

@pnzrr
Copy link

pnzrr commented Nov 26, 2024

@xgp
Copy link
Member

xgp commented Nov 28, 2024

@olivier34000 can you please try the image that was released yesterday? 26.0.6.1732738384

@olivier34000
Copy link
Author

@xgp I checked the new release but it doesn't work. I restored Keycloak with the version 25. With KC_HOSTNAME_ADMIN_URL and KC_HOSTNAME_URL it worked well. However KC_HOSTNAME_ADMIN and KC_HOSTNAME it didn't work.
With the verison 26 KC_HOSTNAME_ADMIN_URL and KC_HOSTNAME_URL doesn't work anymore as explained in the docs https://www.keycloak.org/docs/26.0.6/upgrading/#new-hostname-options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants