CORS error for keycloakendpoint from UI browser in RHOCP4

Solution Verified - Updated -

Issue

  • When trying to log in to the application, the token retrieval fails.
  • CORS errors occur in OpenShift web apps when attempting to fetch tokens from Keycloak due to cross-origin restrictions.
Access to XMLHttpRequest at 'https://keycloak-keycloak-project.xxxx.xxxx.xxxx./auth/realms/Zync/protocol/openid-connect/token' from origin '<local host URL>' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
  • Despite hosting on OpenShift, the issue hints at a specific problem with Keycloak's CORS setup.

Environment

  • Red Hat OpenShift Container Platform (RHOCP) 4.12 +

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content