org.keycloak.storage.ldap.mappers

## Class HardcodedAttributeMapper

- java.lang.Object
- - org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapper
  - - org.keycloak.storage.ldap.mappers.HardcodedAttributeMapper

- All Implemented Interfaces:
    Provider, LDAPStorageMapper

      public class HardcodedAttributeMapper
      extends AbstractLDAPStorageMapper

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `ATTRIBUTE_VALUE`
    `static String` | `USER_MODEL_ATTRIBUTE`

    - ### Fields inherited from class org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapper

      `ldapProvider, mapperModel, session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HardcodedAttributeMapper(ComponentModel mapperModel, LDAPStorageProvider ldapProvider)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beforeLDAPQuery(LDAPQuery query)` Called before LDAP Identity query for retrieve LDAP users was executed.
    `void` | `onImportUserFromLDAP(LDAPObject ldapUser, UserModel user, RealmModel realm, boolean isCreate)` Called when importing user from LDAP to local keycloak DB.
    `void` | `onRegisterUserToLDAP(LDAPObject ldapUser, UserModel localUser, RealmModel realm)` Called when register new user to LDAP - just after user was created in Keycloak DB
    `UserModel` | `proxy(LDAPObject ldapUser, UserModel delegate, RealmModel realm)` Called when invoke proxy on LDAP federation provider
    `protected void` | `setPropertyOnUserModel(Property<Object> userModelProperty, UserModel user, String ldapAttrValue)`

    - ### Methods inherited from class org.keycloak.storage.ldap.mappers.AbstractLDAPStorageMapper

      `close, getGroupMembers, getLdapProvider, getRoleMembers, onAuthenticationFailure, parseBooleanParameter, syncDataFromFederationProviderToKeycloak, syncDataFromKeycloakToFederationProvider`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### USER_MODEL_ATTRIBUTE

          public static final String USER_MODEL_ATTRIBUTE

      See Also:
        Constant Field Values

    - #### ATTRIBUTE_VALUE

          public static final String ATTRIBUTE_VALUE

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### HardcodedAttributeMapper

          public HardcodedAttributeMapper(ComponentModel mapperModel,
                                          LDAPStorageProvider ldapProvider)

  - ### Method Detail

    - #### onImportUserFromLDAP

          public void onImportUserFromLDAP(LDAPObject ldapUser,
                                           UserModel user,
                                           RealmModel realm,
                                           boolean isCreate)

      Description copied from interface: `LDAPStorageMapper`
      Called 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

          public void onRegisterUserToLDAP(LDAPObject ldapUser,
                                           UserModel localUser,
                                           RealmModel realm)

      Description copied from interface: `LDAPStorageMapper`
      Called when register new user to LDAP - just after user was created in Keycloak DB

    - #### proxy

          public UserModel proxy(LDAPObject ldapUser,
                                 UserModel delegate,
                                 RealmModel realm)

      Description copied from interface: `LDAPStorageMapper`
      Called when invoke proxy on LDAP federation provider
      Returns:

    - #### setPropertyOnUserModel

          protected void setPropertyOnUserModel(Property<Object> userModelProperty,
                                                UserModel user,
                                                String ldapAttrValue)

    - #### beforeLDAPQuery

          public void beforeLDAPQuery(LDAPQuery query)

      Description copied from interface: `LDAPStorageMapper`
      Called before LDAP Identity query for retrieve LDAP users was executed. It allows to change query somehow (add returning attributes from LDAP, change conditions etc)

Copyright © 2020 JBoss by Red Hat. All rights reserved.