Class LDAPIdentityStore
java.lang.Object
org.keycloak.storage.ldap.idm.store.ldap.LDAPIdentityStore
- All Implemented Interfaces:
IdentityStore
An IdentityStore implementation backed by an LDAP directory
- Author:
- Shane Bryzak, Anil Saldhana, Pedro Silva
-
Constructor Summary
ConstructorsConstructorDescriptionLDAPIdentityStore(org.keycloak.models.KeycloakSession session, LDAPConfig config) -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(LDAPObject ldapObject) Persists the specified IdentityTypevoidaddMemberToGroup(LdapName groupDn, String memberAttrName, String value) Adds a member to a group.protected voidcheckRename(LDAPObject ldapObject) intcountQueryResults(LDAPQuery identityQuery) protected ConditioncreateIdentityTypeSearchFilter(LDAPQuery identityQuery) protected BasicAttributesextractAttributesForSaving(LDAPObject ldapObject, boolean isCreate) fetchQueryResults(LDAPQuery identityQuery) Returns the configuration for this IdentityStore instanceSet<org.keycloak.representations.idm.LDAPCapabilityRepresentation>Query the LDAP server RootDSE and extract theLDAPCapabilityRepresentationof all supported extensions, controls and features the server announces.voidremove(LDAPObject ldapObject) Removes the specified IdentityTypevoidremoveMemberFromGroup(LdapName groupDn, String memberAttrName, String value) Removes a member from a group.voidupdate(LDAPObject ldapObject) Updates the specified IdentityTypevoidupdatePassword(LDAPObject user, String password, LDAPOperationDecorator passwordUpdateDecorator) Updates the specified credential value.voidvalidatePassword(LDAPObject user, String password) Validates the specified credentials.
-
Constructor Details
-
LDAPIdentityStore
-
-
Method Details
-
getConfig
Description copied from interface:IdentityStoreReturns the configuration for this IdentityStore instance- Specified by:
getConfigin interfaceIdentityStore- Returns:
-
add
Description copied from interface:IdentityStorePersists the specified IdentityType- Specified by:
addin interfaceIdentityStore
-
addMemberToGroup
Description copied from interface:IdentityStoreAdds a member to a group.- Specified by:
addMemberToGroupin interfaceIdentityStore- Parameters:
groupDn- The DN of the group objectmemberAttrName- The member attribute namevalue- The value (it can be uid or dn depending the group type)
-
removeMemberFromGroup
Description copied from interface:IdentityStoreRemoves a member from a group.- Specified by:
removeMemberFromGroupin interfaceIdentityStore- Parameters:
groupDn- The DN of the group objectmemberAttrName- The member attribute namevalue- The value (it can be uid or dn depending the group type)
-
update
Description copied from interface:IdentityStoreUpdates the specified IdentityType- Specified by:
updatein interfaceIdentityStore
-
checkRename
-
remove
Description copied from interface:IdentityStoreRemoves the specified IdentityType- Specified by:
removein interfaceIdentityStore
-
fetchQueryResults
- Specified by:
fetchQueryResultsin interfaceIdentityStore
-
countQueryResults
- Specified by:
countQueryResultsin interfaceIdentityStore
-
queryServerCapabilities
Description copied from interface:IdentityStoreQuery the LDAP server RootDSE and extract theLDAPCapabilityRepresentationof all supported extensions, controls and features the server announces. The LDAP Wiki provides a list of known capabilities. Will throw aModelExceptionon any LDAP error, or when the searchResult is empty.- Specified by:
queryServerCapabilitiesin interfaceIdentityStore- Returns:
- a set of LDAPOid, each representing a server capability (control, extension or feature).
-
validatePassword
Description copied from interface:IdentityStoreValidates the specified credentials.- Specified by:
validatePasswordin interfaceIdentityStore- Parameters:
user- Keycloak userpassword- Ldap password- Throws:
AuthenticationException- if authentication is not successful
-
updatePassword
public void updatePassword(LDAPObject user, String password, LDAPOperationDecorator passwordUpdateDecorator) Description copied from interface:IdentityStoreUpdates the specified credential value.- Specified by:
updatePasswordin interfaceIdentityStore- Parameters:
user- Keycloak userpassword- Ldap passwordpasswordUpdateDecorator- Callback to be executed before/after password update. Can be null
-
createIdentityTypeSearchFilter
-
extractAttributesForSaving
-
getPasswordModificationTimeAttributeName
-