keycloak-scim/bundled-war-example
Bill Burke 62f8811a46 Merge remote-tracking branch 'upstream/master'
Conflicts:
	bundled-war-example/src/main/java/org/keycloak/server/KeycloakServerApplication.java
	bundled-war-example/src/main/webapp/WEB-INF/web.xml
2014-04-28 18:04:50 -04:00
..
src/main Merge remote-tracking branch 'upstream/master' 2014-04-28 18:04:50 -04:00
pom.xml KEYCLOAK-430 Fix bundled war example 2014-04-28 13:36:34 +01:00
README.md app/keycloak self bootstrapping bundle 2014-04-11 13:24:07 -04:00

Self Bootstrapping Keycloak Server and Bundled Application

This is an example of bundling the Keycloak server with an app within the same WAR in an EAP 6.x environment.

  • On bootup, a default realm is imported from WEB-INF/testrealm.json if it doesn't exist yet.

  • On bootup, the adapter config is created on the fly and configured with the testrealm imported.

  • The application is secured with keycloak (see jboss-web.xml)

  • web.xml security constraints are set for the secured URLs that are secured by keycloak

  • Because of weirdness with Resteasy 2.3.x, any secured JAX-RS urls from the application must have a security constraint that denies all as they will be reachable in two places. Under the Keycloak REST url "/rest" and under the application's REST url "/database".

  • Adapter config can be modified on the fly by getting the AdapterDeploymentContext from a servlet context attribute.

  • You must specify a host-port context param so that the auth url for AdapterConfig can be set correctly.

  • Run this demo by going to http://localhost:8080/app-bundle. Then click on the url.