Deploy KeyCloak as WAR in your WildFly server.
The project consists of the following modules:
Contains the basic KeyCloak-Application class and defines the dependencies for the WAR
Example WAR configuration: By default creates a demo-realm with users and installs admin user. Data is kept in H2 database ${jboss.server.data.dir}/keycloak.db
Just copy the WAR into the deployments/ directory of your WildFly/EAP server and start it. Then point your browser to
http://localhost:8080/auth/admin/master/console/
and login as admin.
Admin user is kept in file META-INF/keycloak-add-user.json which is copied at startup of the WAR to ${jboss.server.config.dir}/
Username: admin Password: RcSTU63zAMkpUqhGGuSCmU9wIbXuDSpv+
-
Start Server
./standalone.sh -Dkeycloak.connectionsJpa.url='jdbc:h2:${jboss.server.data.dir}/keycloak'
-
Configure realm in running KeyCloak and STOP server via Control-C or kill
-
Run KeyCloak/WildFly again
sh standalone.sh -Dkeycloak.connectionsJpa.url='jdbc:h2:${jboss.server.data.dir}/keycloak' -Dkeycloak.migration.action="export" -Dkeycloak.migration.provider="singleFile" -Dkeycloak.migration.file="/tmp/master.json" -Dkeycloak.migration.realmName="master" -Dkeycloak.migration.usersExportStrategy="REALM_FILE"
After export is done SHUTDOWN the process via Control-C or kill
If you do not want to keep data between restarts use a in-memory data base
./standalone.sh -Dkeycloak.connectionsJpa.url='jdbc:h2:mem:keycloak;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE'