[keycloak-user] CORS setup

Zeus Arias Lucero | BEEVA zeus.arias at beeva.com
Fri Dec 2 05:20:09 EST 2016


Hi,

Is it possible to configure cors? Which are the steps?

My config client is (json):

{
  "realm": "name",
  "realm-public-key": "...",
  "auth-server-url": "https://example:8443/auth",
  "ssl-required": "all",
  "resource": "name",
  "enable-cors": true,
  "cors-allowed-methods": "GET, HEAD, OPTIONS",
  "cors-allowed-headers": "Origin, Accept, X-Requested-With, Content-Type,
Access-Control-Request-Method, Access-Control-Request-Headersl",
  "credentials": {
    "secret": "...."
  },
  "principal-attribute": "preferred_username"
}


And error the application is:

XMLHttpRequest cannot load
https://keycloak_url:8443/auth/realms/name/protocol/open…gin&state=1%2token&login=true&scope=openid.
No 'Access-Control-Allow-Origin' header is present on the requested
resource. Origin 'https://url_app' is therefore not allowed access.

The Keycloak Response Header is:

Cache-Control:no-store, must-revalidate, max-age=0
Connection:keep-alive
Content-Length:5257
Content-Security-Policy:frame-src 'self'
Content-Type:text/html;charset=utf-8
Date:Fri, 02 Dec 2016 09:37:15 GMT
Server:WildFly/10
Set-Cookie:KC_RESTART=COOKIE; Version=1; Path=/auth/realms/name; Secure;
HttpOnly
X-Content-Type-Options:nosniff
X-Frame-Options:SAMEORIGIN
X-Powered-By:Undertow/1

Do I have to modify the file standalone.xml?


More information about the keycloak-user mailing list