Class AbstractLDAPStorageMapper
java.lang.Object
org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapper
- All Implemented Interfaces:
Provider,LDAPStorageMapper
- Direct Known Subclasses:
FullNameLDAPStorageMapper,GroupLDAPStorageMapper,HardcodedAttributeMapper,HardcodedLDAPAttributeMapper,HardcodedLDAPGroupStorageMapper,HardcodedLDAPRoleStorageMapper,KerberosPrincipalAttributeMapper,MSADLDSUserAccountControlStorageMapper,MSADUserAccountControlStorageMapper,RoleLDAPStorageMapper,UserAttributeLDAPStorageMapper
Stateful per-request object
- Author:
- Marek Posolda
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final LDAPStorageProviderprotected final ComponentModelprotected final KeycloakSession -
Constructor Summary
ConstructorsConstructorDescriptionAbstractLDAPStorageMapper(ComponentModel mapperModel, LDAPStorageProvider ldapProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()getGroupMembers(RealmModel realm, GroupModel group, int firstResult, int maxResults) Return empty list if doesn't support storing of groupsGets the ldap provider associated to the mapper.getRoleMembers(RealmModel realm, RoleModel role, int firstResult, int maxResults) Return empty list if doesn't support storing of rolesMethod that returns user model attributes, which this mapper maps to Keycloak usersMethod that returns the mandatory attributes that this mapper imposes on the entry.booleanonAuthenticationFailure(LDAPObject ldapUser, UserModel user, AuthenticationException ldapException, RealmModel realm) Called when LDAP authentication of specified user fails.static booleanparseBooleanParameter(ComponentModel mapperModel, String paramName) Sync data from federated storage to Keycloak.Sync data from Keycloak back to federated storageMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.storage.ldap.mappers.LDAPStorageMapper
beforeLDAPQuery, onImportUserFromLDAP, onRegisterUserToLDAP, proxy
-
Field Details
-
session
-
mapperModel
-
ldapProvider
-
-
Constructor Details
-
AbstractLDAPStorageMapper
-
-
Method Details
-
syncDataFromFederationProviderToKeycloak
Description copied from interface:LDAPStorageMapperSync data from federated storage to Keycloak. It's useful just if mapper needs some data preloaded from federated storage (For example load roles from federated provider and sync them to Keycloak database) Applicable just if sync is supported- Specified by:
syncDataFromFederationProviderToKeycloakin interfaceLDAPStorageMapper
-
syncDataFromKeycloakToFederationProvider
Description copied from interface:LDAPStorageMapperSync data from Keycloak back to federated storage- Specified by:
syncDataFromKeycloakToFederationProviderin interfaceLDAPStorageMapper
-
getGroupMembers
public List<UserModel> getGroupMembers(RealmModel realm, GroupModel group, int firstResult, int maxResults) Description copied from interface:LDAPStorageMapperReturn empty list if doesn't support storing of groups- Specified by:
getGroupMembersin interfaceLDAPStorageMapper
-
getRoleMembers
public List<UserModel> getRoleMembers(RealmModel realm, RoleModel role, int firstResult, int maxResults) Description copied from interface:LDAPStorageMapperReturn empty list if doesn't support storing of roles- Specified by:
getRoleMembersin interfaceLDAPStorageMapper- Returns:
-
onAuthenticationFailure
public boolean onAuthenticationFailure(LDAPObject ldapUser, UserModel user, AuthenticationException ldapException, RealmModel realm) Description copied from interface:LDAPStorageMapperCalled when LDAP authentication of specified user fails. If any mapper returns true from this method, AuthenticationException won't be rethrown!- Specified by:
onAuthenticationFailurein interfaceLDAPStorageMapper- Returns:
- true if mapper processed the AuthenticationException and did some actions based on that. In that case, AuthenticationException won't be rethrown!
-
mandatoryAttributeNames
Description copied from interface:LDAPStorageMapperMethod that returns the mandatory attributes that this mapper imposes on the entry.- Specified by:
mandatoryAttributeNamesin interfaceLDAPStorageMapper- Returns:
- The list of mandatory attributes or null
-
getUserAttributes
Description copied from interface:LDAPStorageMapperMethod that returns user model attributes, which this mapper maps to Keycloak users- Specified by:
getUserAttributesin interfaceLDAPStorageMapper- Returns:
- user model attributes. Returns empty set if not user attributes provided by this mapper. Never returns null.
-
parseBooleanParameter
-
getLdapProvider
Description copied from interface:LDAPStorageMapperGets the ldap provider associated to the mapper.- Specified by:
getLdapProviderin interfaceLDAPStorageMapper- Returns:
-
close
public void close()
-