Sync User จาก OpenLDAP ไปยัง Keycloak

wk
1 min readJan 16, 2020

--

1. ติดตั้ง OpenLDAP และ Keycloak ด้วย Docker

  • สร้างไฟล์ docker-compose.yml
  • สร้างไฟล์ postgres/init.sh
  • รันโปรแกรมด้วยคำสั่ง
docker-compose up

2. Import User เข้า OpenLDAP

ใช้โปรแกรม ldapmodify โดยโหลดข้อมูล User จากไฟล์ d.ldif

ldapmodify -h localhost \
-D "cn=admin,dc=example,dc=org" \
-w admin \
-p 10389 \
-a -f ldap/d.ldif

สามารถดาวน์โหลด ไฟล์ d.ldif จาก link นี้

3. Sync User ผ่านหน้า UI ของ Keycloak

  • กดปุ่ม Synchronize all users เพื่อ Sync ข้อมูลทั้งหมดจาก OpenLDAP
  • เลือกแท็บ Users จะพบว่ามีข้อมูลที่ Sync จาก OpenLDAP ดังนี้

--

--

No responses yet