Cause
The keycloak uses the default Java 1.8 as truststore instead of the Java 17 truststore.
Solution
Procedure
- To obtain LDAP server certificate, do the following:
- Export the LDAP server certificate:
- View the LDAP server certificate:
echo | openssl s_client -connect ldap.example.com:636 -showcerts
- Copy the certificate to a file. For example: ldap-server.crt
- Import the LDAP certificate into keycloak truststore:
keytool -importcert -file ldap-server.crt -alias ldap-server -keystore /path/to/keycloak/conf/cacerts -storepass changeit
- To configure LDAP in keycloak, do the following:
- Log into keycloak admin console.
- Navigate to the required realm.
- Click .
- In the Connection URL field, enter one of the following:
For IP address, enter ldaps://10.133.98.168:636
For FQDN, enter ldaps://aadsldap.gsc.com:636
- Click Test Connection
- Enter Bind DN and Bind credentials.
- Click Test authentication.
Successfully connected to LDAP is displayed.
- Under LDAP searching and updating section, do the following:
Enter User DN. For example: OU=uc7_smg,DC=gsc,DC=com.
For Username LDAP attribute, enter one of the following:
sAMA account name
User principal name
Email address.
Note:
Name of the LDAP attribute, which is mapped as Keycloak username. For many LDAP server vendors it can be 'uid'. For Active directory it can be 'sAMAccountName' or 'cn'. The attribute should be filled for all LDAP user records you want to import from LDAP to Keycloak.
- Enable Periodic full sync.
- Click Save.