Class UserAttributeLDAPStorageMapper
java.lang.Object
org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapper
org.keycloak.storage.ldap.mappers.UserAttributeLDAPStorageMapper
- All Implemented Interfaces:
Provider,LDAPStorageMapper
- Direct Known Subclasses:
CertificateLDAPStorageMapper
- Author:
- Marek Posolda
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapper
ldapProvider, mapperModel -
Constructor Summary
ConstructorsConstructorDescriptionUserAttributeLDAPStorageMapper(ComponentModel mapperModel, LDAPStorageProvider ldapProvider) -
Method Summary
Modifier and TypeMethodDescriptionvoidbeforeLDAPQuery(LDAPQuery query) Called before LDAP Identity query for retrieve LDAP users was executed.protected voidcheckDuplicateEmail(String userModelAttrName, String email, RealmModel realm, KeycloakSession session, UserModel user) protected voidcheckDuplicateUsername(String userModelAttrName, String username, RealmModel realm, KeycloakSession session, UserModel user) Method that returns user model attributes, which this mapper maps to Keycloak usersMethod that returns the mandatory attributes that this mapper imposes on the entry.voidonImportUserFromLDAP(LDAPObject ldapUser, UserModel user, RealmModel realm, boolean isCreate) Called when importing user from LDAP to local keycloak DB.voidonRegisterUserToLDAP(LDAPObject ldapUser, UserModel localUser, RealmModel realm) Called when register new user to LDAP - just after user was created in Keycloak DBproxy(LDAPObject ldapUser, UserModel delegate, RealmModel realm) Called when invoke proxy on LDAP federation providerprotected voidsetPropertyOnUserModel(Property<Object> userModelProperty, UserModel user, String ldapAttrValue) Methods inherited from class org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapper
close, getGroupMembers, getLdapProvider, getRoleMembers, getSession, onAuthenticationFailure, parseBooleanParameter, syncDataFromFederationProviderToKeycloak, syncDataFromKeycloakToFederationProvider
-
Field Details
-
USER_MODEL_ATTRIBUTE
- See Also:
-
LDAP_ATTRIBUTE
- See Also:
-
READ_ONLY
- See Also:
-
ALWAYS_READ_VALUE_FROM_LDAP
- See Also:
-
IS_MANDATORY_IN_LDAP
- See Also:
-
IS_BINARY_ATTRIBUTE
- See Also:
-
ATTRIBUTE_DEFAULT_VALUE
- See Also:
-
FORCE_DEFAULT_VALUE
- See Also:
-
-
Constructor Details
-
UserAttributeLDAPStorageMapper
-
-
Method Details
-
onImportUserFromLDAP
public void onImportUserFromLDAP(LDAPObject ldapUser, UserModel user, RealmModel realm, boolean isCreate) Description copied from interface:LDAPStorageMapperCalled when importing user from LDAP to local keycloak DB.isCreate- true if we importing new user from LDAP. False if user already exists in Keycloak, but we are upgrading (syncing) it from LDAP
-
onRegisterUserToLDAP
Description copied from interface:LDAPStorageMapperCalled when register new user to LDAP - just after user was created in Keycloak DB -
mandatoryAttributeNames
Description copied from interface:LDAPStorageMapperMethod that returns the mandatory attributes that this mapper imposes on the entry.- Specified by:
mandatoryAttributeNamesin interfaceLDAPStorageMapper- Overrides:
mandatoryAttributeNamesin classAbstractLDAPStorageMapper- 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- Overrides:
getUserAttributesin classAbstractLDAPStorageMapper- Returns:
- user model attributes. Returns empty set if not user attributes provided by this mapper. Never returns null.
-
checkDuplicateEmail
protected void checkDuplicateEmail(String userModelAttrName, String email, RealmModel realm, KeycloakSession session, UserModel user) -
checkDuplicateUsername
protected void checkDuplicateUsername(String userModelAttrName, String username, RealmModel realm, KeycloakSession session, UserModel user) -
proxy
Description copied from interface:LDAPStorageMapperCalled when invoke proxy on LDAP federation provider- Returns:
-
beforeLDAPQuery
Description copied from interface:LDAPStorageMapperCalled before LDAP Identity query for retrieve LDAP users was executed. It allows to change query somehow (add returning attributes from LDAP, change conditions etc) -
setPropertyOnUserModel
-