Skip to content

Instantly share code, notes, and snippets.

@mcupak
Created October 9, 2017 04:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcupak/d15f9ea8ca8ac5af6dbdd9950cfb6610 to your computer and use it in GitHub Desktop.
Save mcupak/d15f9ea8ca8ac5af6dbdd9950cfb6610 to your computer and use it in GitHub Desktop.
Enable CORS for Keycloak.
/subsystem=keycloak/realm=sample-realm:write-attribute\
(name=cors-max-age,value=1000)
/subsystem=keycloak/realm=sample-realm:write-attribute\
(name=cors-allowed-methods,value="GET, POST, PUT, DELETE, OPTIONS, HEAD")
/subsystem=keycloak/realm=sample-realm:write-attribute\
(name=enable-cors,value=true)
@AlessandroEmm
Copy link

is this actually supposed to work with the latest keycloak version? jboss cli tellsme there is no subsystem "keycloak"..

@naturalbeau
Copy link

@AlessandroEmm Did you solve the issue? I have the same problem.

@mcupak
Copy link
Author

mcupak commented Jan 31, 2020

Looking at the docs, the subsystem is called keycloak-server as of KC 8.0.1.

@naturalbeau
Copy link

@mcupak Thanks. The subsystem is called keycloak-server, but it shows it cannot find the realm resource.
org.jboss.as.cli.CommandFormatException: Failed to get the list of the operation properties: "WFLYCTL0030: No resource definition is registered for address [
("subsystem" => "keycloak-server"),
("realm" => "sample-realm")
]": Failed to get the list of the operation properties: "WFLYCTL0030: No resource definition is registered for address [
("subsystem" => "keycloak-server"),
("realm" => "sample-realm")
]"
18:12:52,012 INFO [org.jboss.as] (MSC service thread 1-2) WFLYSRV0050: Keycloak 4.5.0.Final (WildFly Core 5.0.0.Final) stopped in 27ms

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment