Interface IdentityStore
- All Known Implementing Classes:
LDAPIdentityStore
public interface IdentityStore
IdentityStore representation providing minimal SPI
TODO: Rather remove this abstraction
- Author:
- Boleslaw Dawidowicz, Shane Bryzak
-
Method Summary
Modifier and TypeMethodDescriptionvoidadd(LDAPObject ldapObject) Persists the specified IdentityTypevoidaddMemberToGroup(LdapName groupDn, String memberAttrName, String value) Adds a member to a group.intcountQueryResults(LDAPQuery LDAPQuery) fetchQueryResults(LDAPQuery LDAPQuery) Returns the configuration for this IdentityStore instanceQuery 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.
-
Method Details
-
getConfig
LDAPConfig getConfig()Returns the configuration for this IdentityStore instance- Returns:
-
add
Persists the specified IdentityType- Parameters:
ldapObject-
-
update
Updates the specified IdentityType- Parameters:
ldapObject-
-
remove
Removes the specified IdentityType- Parameters:
ldapObject-
-
addMemberToGroup
Adds a member to a group.- 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
Removes a member from a group.- Parameters:
groupDn- The DN of the group objectmemberAttrName- The member attribute namevalue- The value (it can be uid or dn depending the group type)
-
fetchQueryResults
-
countQueryResults
-
queryServerCapabilities
Set<LDAPCapabilityRepresentation> queryServerCapabilities()Query 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.- Returns:
- a set of LDAPOid, each representing a server capability (control, extension or feature).
-
validatePassword
Validates the specified credentials.- Parameters:
user- Keycloak userpassword- Ldap password- Throws:
AuthenticationException- if authentication is not successful
-
updatePassword
void updatePassword(LDAPObject user, String password, LDAPOperationDecorator passwordUpdateDecorator) Updates the specified credential value.- Parameters:
user- Keycloak userpassword- Ldap passwordpasswordUpdateDecorator- Callback to be executed before/after password update. Can be null
-