org.keycloak.federation.ldap.mappers

## Interface LDAPFederationMapper

- All Superinterfaces:
    Provider, UserFederationMapper
  All Known Implementing Classes:
    LDAPFederationMapperBridge

      public interface LDAPFederationMapper
      extends UserFederationMapper

  Author:
    Marek Posolda

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `beforeLDAPQuery(UserFederationMapperModel mapperModel, LDAPQuery query)` Called before LDAP Identity query for retrieve LDAP users was executed.
    `boolean` | `onAuthenticationFailure(UserFederationMapperModel mapperModel, LDAPFederationProvider ldapProvider, LDAPObject ldapUser, UserModel user, AuthenticationException ldapException, RealmModel realm)` Called when LDAP authentication of specified user fails.
    `void` | `onImportUserFromLDAP(UserFederationMapperModel mapperModel, LDAPFederationProvider ldapProvider, LDAPObject ldapUser, UserModel user, RealmModel realm, boolean isCreate)` Called when importing user from LDAP to local keycloak DB.
    `void` | `onRegisterUserToLDAP(UserFederationMapperModel mapperModel, LDAPFederationProvider ldapProvider, LDAPObject ldapUser, UserModel localUser, RealmModel realm)` Called when register new user to LDAP - just after user was created in Keycloak DB
    `UserModel` | `proxy(UserFederationMapperModel mapperModel, LDAPFederationProvider ldapProvider, LDAPObject ldapUser, UserModel delegate, RealmModel realm)` Called when invoke proxy on LDAP federation provider

    - ### Methods inherited from interface org.keycloak.mappers.UserFederationMapper

      `getGroupMembers, syncDataFromFederationProviderToKeycloak, syncDataFromKeycloakToFederationProvider`

    - ### Methods inherited from interface org.keycloak.provider.Provider

      `close`

- - ### Method Detail

    - #### onImportUserFromLDAP

          void onImportUserFromLDAP(UserFederationMapperModel mapperModel,
                                    LDAPFederationProvider ldapProvider,
                                    LDAPObject ldapUser,
                                    UserModel user,
                                    RealmModel realm,
                                    boolean isCreate)

      Called when importing user from LDAP to local keycloak DB.
      Parameters:
        `mapperModel` -
        `ldapProvider` -
        `ldapUser` -
        `user` -
        `realm` -
        `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

          void onRegisterUserToLDAP(UserFederationMapperModel mapperModel,
                                    LDAPFederationProvider ldapProvider,
                                    LDAPObject ldapUser,
                                    UserModel localUser,
                                    RealmModel realm)

      Called when register new user to LDAP - just after user was created in Keycloak DB
      Parameters:
        `mapperModel` -
        `ldapProvider` -
        `ldapUser` -
        `localUser` -
        `realm` -

    - #### proxy

          UserModel proxy(UserFederationMapperModel mapperModel,
                          LDAPFederationProvider ldapProvider,
                          LDAPObject ldapUser,
                          UserModel delegate,
                          RealmModel realm)

      Called when invoke proxy on LDAP federation provider
      Parameters:
        `mapperModel` -
        `ldapProvider` -
        `ldapUser` -
        `delegate` -
        `realm` -
      Returns:

    - #### beforeLDAPQuery

          void beforeLDAPQuery(UserFederationMapperModel mapperModel,
                               LDAPQuery query)

      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)
      Parameters:
        `mapperModel` -
        `query` -

    - #### onAuthenticationFailure

          boolean onAuthenticationFailure(UserFederationMapperModel mapperModel,
                                          LDAPFederationProvider ldapProvider,
                                          LDAPObject ldapUser,
                                          UserModel user,
                                          AuthenticationException ldapException,
                                          RealmModel realm)

      Called when LDAP authentication of specified user fails. If any mapper returns true from this method, AuthenticationException won't be rethrown!
      Parameters:
        `mapperModel` -
        `ldapProvider` -
        `realm` -
        `user` -
        `ldapUser` -
        `ldapException` -
      Returns:
        true if mapper processed the AuthenticationException and did some actions based on that. In that case, AuthenticationException won't be rethrown!

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