From Dogtag
Revision as of 18:39, 9 August 2019 by Edewata (talk | contribs) (Configuring Tomcat)

Jump to: navigation, search


To install Keycloak server:

$ wget
$ tar xzvf keycloak-6.0.1.tar.gz
$ cd keycloak-6.0.1/bin
$ ./ -u admin -p Secret.123
$ ./ -b=

Adding a New Realm

To access the Admin Console, open http://$HOSTNAME:8080/auth/admin/.

To access a realm, open http://$HOSTNAME:8080/auth/realms/<realm>/account.

Configuring Tomcat

To install Tomcat adapter for Keycloak:

  • Download keycloak-tomcat8-adapter-dist.jar.gz
  • Install jar files in <catalina.base>/lib
  • Edit tomcat-user.xml
  • Add admin-gui role
  • Edit index.html
  • Edit context.xml
  • Add Keycloak Valve
  • Add keycloak.json
  • Edit web.xml
  • Define security constraints
  • Define login-config with auth-method set to KEYCLOAK

To register Tomcat client:

  • Open Keycloak Admin Console
  • Open Clients
  • Add client:
    • Client protocol: openid-connect
    • Access type: public
    • Valid redirect URIs: http://localhost:/<app>/*
  • Open Installation
    • Format option: Keycloak JSON
  • Store in WEB-INF/keycloak.json

See Also