From 99eb6d991aee5164fb42aeb9d6ae92837004b3a2 Mon Sep 17 00:00:00 2001 From: Sebastian Schuster Date: Tue, 19 Nov 2024 16:42:03 +0100 Subject: [PATCH] Adapted example to work with bitnami/openldap --- docker-compose.yml | 6 ++---- example/client_authorization_policys.tf | 4 ++++ example/main.tf | 6 +++--- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index d36730cfa..53eacdbdc 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,14 +7,12 @@ services: - POSTGRES_USER=keycloak - POSTGRES_PASSWORD=password image: postgres:16 - ports: - - 5432:5432 volumes: - postgres:/var/lib/postgresql openldap: image: bitnami/openldap:2.6 - ports: - - 8389:389 + environment: + LDAP_PORT_NUMBER: 389 keycloak: image: quay.io/keycloak/keycloak:21.0.1 command: --verbose start-dev --features=preview diff --git a/example/client_authorization_policys.tf b/example/client_authorization_policys.tf index 3aea7bc41..d219817a0 100644 --- a/example/client_authorization_policys.tf +++ b/example/client_authorization_policys.tf @@ -191,4 +191,8 @@ resource "keycloak_openid_client_permissions" "my_permission" { description = "my description" decision_strategy = "UNANIMOUS" } + //needed because otherwise there is a conflict/race condition with the other permission + depends_on = [ + keycloak_users_permissions.my_permission + ] } diff --git a/example/main.tf b/example/main.tf index 01a1c8810..3aa2ae8a3 100644 --- a/example/main.tf +++ b/example/main.tf @@ -103,7 +103,7 @@ resource "keycloak_realm" "test" { resource "keycloak_required_action" "custom-terms-and-conditions" { realm_id = keycloak_realm.test.realm - alias = "terms_and_conditions" + alias = "TERMS_AND_CONDITIONS" default_action = true enabled = true name = "Custom Terms and Conditions" @@ -290,7 +290,7 @@ resource "keycloak_ldap_user_federation" "openldap" { connection_url = "ldap://openldap" users_dn = "dc=example,dc=org" bind_dn = "cn=admin,dc=example,dc=org" - bind_credential = "admin" + bind_credential = "adminpassword" connection_timeout = "5s" read_timeout = "10s" @@ -327,7 +327,7 @@ resource "keycloak_ldap_user_federation" "openldap_no_default_mappers" { connection_url = "ldap://openldap" users_dn = "dc=example,dc=org" bind_dn = "cn=admin,dc=example,dc=org" - bind_credential = "admin" + bind_credential = "adminpassword" connection_timeout = "5s" read_timeout = "10s"