Skip to content

Example how to make members of a specific LDAP group admin of a Keycloak realm

License

Notifications You must be signed in to change notification settings

Brackmeister/keycloak_admin_from_ldap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Keycloak realm with LDAP federation and automatic realm-admin role

Inspired by https://www.janua.fr/mapping-ldap-group-and-roles-to-redhat-sso-keycloak/

Docker container with preloaded LDAP users and groups by https://github.com/rroemhild/docker-test-openldap

Setup

Start the necessary docker containers.

cd docker
docker compose up -d
cd ..

Wait a bit until the keycloak container is up and running. It's ready when docker logs -f kc_admin_keycloak shows "Running the server in development mode. DO NOT use this configuration in production."

Create the realm "futurama" with user federation to the kc_admin_ldap container

cd terraform
terraform init
terraform apply
cd ..

Testing the setup

Normal user login

  1. Open http://localhost:8099/realms/futurama/account/
  2. Login as "professor@planetexpress.com/professor" or "bender@planetexpress.com/bender" for example --> both work

Login as admin of realm "futurama"

  1. Open http://localhost:8099/admin/futurama/console/
  2. Login as "bender@planetexpress.com/bender" --> you should see a mostly blank page with message "Request failed with status code 403"
  3. Logout
  4. Login as "professor@planetexpress.com/professor" --> you should see a "Welcome to futurama" page plus full menu to manage the realm

Additional information

About

Example how to make members of a specific LDAP group admin of a Keycloak realm

Topics

Resources

License

Stars

Watchers

Forks

Languages