diff --git a/docbook/reference/en/en-US/modules/user-federation.xml b/docbook/reference/en/en-US/modules/user-federation.xml index 9941a8d2d1..b08a58b306 100755 --- a/docbook/reference/en/en-US/modules/user-federation.xml +++ b/docbook/reference/en/en-US/modules/user-federation.xml @@ -101,7 +101,8 @@ Other options - The rest of the configuration options should be self explanatory. + The rest of the configuration options should be self explanatory. You can use tooltips in admin console + to see some more details about them. @@ -109,6 +110,46 @@ +
+ Sync of LDAP users to Keycloak + + LDAP Federation Provider will automatically take care of synchronization (import) of needed LDAP users into Keycloak database. + For example once you first authenticate LDAP user john from Keycloak UI, LDAP Federation provider will + first import this LDAP user into Keycloak database and then authenticate against LDAP password. + + + Thing is that Federation Provider import just requested users by default, so if you click to View all users + in Keycloak admin console, you will see just those LDAP users, which were already authenticated/requested by Keycloak. + + If you want to sync all LDAP users into Keycloak database, you may configure and enable Sync, which is in + admin console on same page like the configuration of Federation provider itself. There are 2 types of sync: + + + Full sync + + + This will synchronize all LDAP users into Keycloak DB. Those LDAP users, which already exist in Keycloak and were + changed in LDAP directly will be updated in Keycloak DB (For example if user Mary Kelly was changed in LDAP to Mary Doe). + + + + + Changed users sync + + + This will check LDAP and it will sync into Keycloak just those users, which were created or updated in LDAP from the time of last sync. + + + + + + + In usual cases you may want to trigger full sync at the beginning, so you will import all LDAP users to Keycloak just once. Then you may setup + periodic sync of changed users, so Keycloak will periodically ask LDAP server for newly created or updated users and backport them to Keycloak DB. + Also you may want to trigger full sync again after some longer time or setup periodic full sync as well. + + In admin console, you can trigger sync directly or you can enable periodic changed or full sync. +
Writing your own User Federation Provider diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-generic.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-generic.html index e5c9017a14..c504eacdce 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-generic.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-generic.html @@ -32,12 +32,14 @@
+
+
@@ -56,24 +58,28 @@
+
+
+
+
diff --git a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-ldap.html b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-ldap.html index 3e9f3db139..debd4d7638 100755 --- a/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-ldap.html +++ b/forms/common-themes/src/main/resources/theme/admin/base/resources/partials/federated-ldap.html @@ -72,6 +72,7 @@ +
@@ -83,18 +84,21 @@
+
+
+ @@ -104,24 +108,28 @@
+
+
+
+ @@ -131,6 +139,7 @@
+
@@ -144,6 +153,8 @@
+
@@ -154,30 +165,35 @@
+
+
+
+
+
diff --git a/services/src/main/java/org/keycloak/services/managers/UsersSyncManager.java b/services/src/main/java/org/keycloak/services/managers/UsersSyncManager.java index e5bd2e6ff5..82d2972b43 100644 --- a/services/src/main/java/org/keycloak/services/managers/UsersSyncManager.java +++ b/services/src/main/java/org/keycloak/services/managers/UsersSyncManager.java @@ -68,7 +68,7 @@ public class UsersSyncManager { try { syncAllUsers(sessionFactory, realmId, fedProvider); } catch (Throwable t) { - logger.error("Error occured during full sync of users", t); + logger.error("Error occurred during full sync of users", t); } } @@ -86,7 +86,7 @@ public class UsersSyncManager { try { syncChangedUsers(sessionFactory, realmId, fedProvider); } catch (Throwable t) { - logger.error("Error occured during sync of changed users", t); + logger.error("Error occurred during sync of changed users", t); } } diff --git a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/SyncProvidersTest.java b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/SyncProvidersTest.java index f4dac01906..35f863b473 100644 --- a/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/SyncProvidersTest.java +++ b/testsuite/integration/src/test/java/org/keycloak/testsuite/forms/SyncProvidersTest.java @@ -1,6 +1,5 @@ package org.keycloak.testsuite.forms; -import java.util.Date; import java.util.HashMap; import java.util.Map; @@ -18,7 +17,6 @@ import org.keycloak.models.KeycloakSession; import org.keycloak.models.KeycloakSessionFactory; import org.keycloak.models.RealmModel; import org.keycloak.models.UserFederationProvider; -import org.keycloak.models.UserFederationProviderFactory; import org.keycloak.models.UserFederationProviderModel; import org.keycloak.models.UserModel; import org.keycloak.models.UserProvider;