Class HardcodedLDAPAttributeMapper
- java.lang.Object
- 
- org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapper
- 
- org.keycloak.storage.ldap.mappers.HardcodedLDAPAttributeMapper
 
 
- 
- All Implemented Interfaces:
- Provider,- LDAPStorageMapper
 
 public class HardcodedLDAPAttributeMapper extends AbstractLDAPStorageMapper - Author:
- Marek Posolda
 
- 
- 
Field SummaryFields Modifier and Type Field Description static StringLDAP_ATTRIBUTE_NAMEstatic StringLDAP_ATTRIBUTE_VALUEstatic StringRANDOM_ATTRIBUTE_VALUEWhen this is configured as LDAP_ATTRIBUTE_VALUE, the mapper will use randomly generated valuestatic Patternsubstitution- 
Fields inherited from class org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapperldapProvider, mapperModel, session
 
- 
 - 
Constructor SummaryConstructors Constructor Description HardcodedLDAPAttributeMapper(ComponentModel mapperModel, LDAPStorageProvider ldapProvider)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeforeLDAPQuery(LDAPQuery query)Called before LDAP Identity query for retrieve LDAP users was executed.protected StringcomputeAttributeValue(String ldapAttrName, String ldapAttrValue, LDAPObject ldapUser, UserModel localUser, RealmModel realm)protected StringgetRandomValue()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 DBUserModelproxy(LDAPObject ldapUser, UserModel delegate, RealmModel realm)Called when invoke proxy on LDAP federation provider- 
Methods inherited from class org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapperclose, getGroupMembers, getLdapProvider, getRoleMembers, mandatoryAttributeNames, onAuthenticationFailure, parseBooleanParameter, syncDataFromFederationProviderToKeycloak, syncDataFromKeycloakToFederationProvider
 
- 
 
- 
- 
- 
Field Detail- 
LDAP_ATTRIBUTE_NAMEpublic static final String LDAP_ATTRIBUTE_NAME - See Also:
- Constant Field Values
 
 - 
LDAP_ATTRIBUTE_VALUEpublic static final String LDAP_ATTRIBUTE_VALUE - See Also:
- Constant Field Values
 
 - 
RANDOM_ATTRIBUTE_VALUEpublic static final String RANDOM_ATTRIBUTE_VALUE When this is configured as LDAP_ATTRIBUTE_VALUE, the mapper will use randomly generated value- See Also:
- Constant Field Values
 
 - 
substitutionpublic static Pattern substitution 
 
- 
 - 
Constructor Detail- 
HardcodedLDAPAttributeMapperpublic HardcodedLDAPAttributeMapper(ComponentModel mapperModel, LDAPStorageProvider ldapProvider) 
 
- 
 - 
Method Detail- 
onRegisterUserToLDAPpublic void onRegisterUserToLDAP(LDAPObject ldapUser, UserModel localUser, RealmModel realm) Description copied from interface:LDAPStorageMapperCalled when register new user to LDAP - just after user was created in Keycloak DB
 - 
computeAttributeValueprotected String computeAttributeValue(String ldapAttrName, String ldapAttrValue, LDAPObject ldapUser, UserModel localUser, RealmModel realm) 
 - 
getRandomValueprotected String getRandomValue() 
 - 
onImportUserFromLDAPpublic 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
 
 - 
proxypublic UserModel proxy(LDAPObject ldapUser, UserModel delegate, RealmModel realm) Description copied from interface:LDAPStorageMapperCalled when invoke proxy on LDAP federation provider- Returns:
 
 - 
beforeLDAPQuerypublic void beforeLDAPQuery(LDAPQuery query) 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)
 
- 
 
-