org.keycloak.federation.ldap.mappers.membership.role

## Class RoleLDAPFederationMapper

- java.lang.Object
- - org.keycloak.federation.ldap.mappers.AbstractLDAPFederationMapper
  - - org.keycloak.federation.ldap.mappers.membership.role.RoleLDAPFederationMapper

- All Implemented Interfaces:
    CommonLDAPGroupMapper

      public class RoleLDAPFederationMapper
      extends AbstractLDAPFederationMapper
      implements CommonLDAPGroupMapper

  Map realm roles or roles of particular client to LDAP groups
  Author:
    Marek Posolda

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `class` | `RoleLDAPFederationMapper.LDAPRoleMappingsUserDelegate`

  - ### Field Summary

    - ### Fields inherited from class org.keycloak.federation.ldap.mappers.AbstractLDAPFederationMapper

      `ldapProvider, mapperModel, realm`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RoleLDAPFederationMapper(UserFederationMapperModel mapperModel, LDAPFederationProvider ldapProvider, RealmModel realm, RoleLDAPFederationMapperFactory factory)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addRoleMappingInLDAP(String roleName, LDAPObject ldapUser)`
    `void` | `beforeLDAPQuery(LDAPQuery query)`
    `LDAPQuery` | `createLDAPGroupQuery()`
    `LDAPObject` | `createLDAPRole(String roleName)`
    `LDAPQuery` | `createRoleQuery()`
    `void` | `deleteRoleMappingInLDAP(LDAPObject ldapUser, LDAPObject ldapRole)`
    `CommonLDAPGroupMapperConfig` | `getConfig()`
    `protected List<LDAPObject>` | `getLDAPRoleMappings(LDAPObject ldapUser)`
    `protected RoleContainerModel` | `getTargetRoleContainer()`
    `LDAPObject` | `loadLDAPRoleByName(String roleName)`
    `void` | `onImportUserFromLDAP(LDAPObject ldapUser, UserModel user, boolean isCreate)`
    `void` | `onRegisterUserToLDAP(LDAPObject ldapUser, UserModel localUser)`
    `UserModel` | `proxy(LDAPObject ldapUser, UserModel delegate)`
    `UserFederationSyncResult` | `syncDataFromFederationProviderToKeycloak()`
    `UserFederationSyncResult` | `syncDataFromKeycloakToFederationProvider()`

    - ### Methods inherited from class org.keycloak.federation.ldap.mappers.AbstractLDAPFederationMapper

      `getGroupMembers, getLdapProvider, getRealm, onAuthenticationFailure, parseBooleanParameter`

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

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

- - ### Constructor Detail

    - #### RoleLDAPFederationMapper

          public RoleLDAPFederationMapper(UserFederationMapperModel mapperModel,
                                          LDAPFederationProvider ldapProvider,
                                          RealmModel realm,
                                          RoleLDAPFederationMapperFactory factory)

  - ### Method Detail

    - #### createLDAPGroupQuery

          public LDAPQuery createLDAPGroupQuery()

      Specified by:
        `createLDAPGroupQuery` in interface `CommonLDAPGroupMapper`

    - #### getConfig

          public CommonLDAPGroupMapperConfig getConfig()

      Specified by:
        `getConfig` in interface `CommonLDAPGroupMapper`

    - #### onImportUserFromLDAP

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

      Specified by:
        `onImportUserFromLDAP` in class `AbstractLDAPFederationMapper`
      See Also:
        `LDAPFederationMapper.onImportUserFromLDAP(UserFederationMapperModel, LDAPFederationProvider, LDAPObject, UserModel, RealmModel, boolean)`

    - #### onRegisterUserToLDAP

          public void onRegisterUserToLDAP(LDAPObject ldapUser,
                                           UserModel localUser)

      Specified by:
        `onRegisterUserToLDAP` in class `AbstractLDAPFederationMapper`
      See Also:
        `LDAPFederationMapper.onRegisterUserToLDAP(UserFederationMapperModel, LDAPFederationProvider, LDAPObject, UserModel, RealmModel)`

    - #### syncDataFromFederationProviderToKeycloak

          public UserFederationSyncResult syncDataFromFederationProviderToKeycloak()

      Overrides:
        `syncDataFromFederationProviderToKeycloak` in class `AbstractLDAPFederationMapper`
      See Also:
        `UserFederationMapper.syncDataFromFederationProviderToKeycloak(UserFederationMapperModel, UserFederationProvider, KeycloakSession, RealmModel)`

    - #### syncDataFromKeycloakToFederationProvider

          public UserFederationSyncResult syncDataFromKeycloakToFederationProvider()

      Overrides:
        `syncDataFromKeycloakToFederationProvider` in class `AbstractLDAPFederationMapper`
      See Also:
        `UserFederationMapper.syncDataFromKeycloakToFederationProvider(UserFederationMapperModel, UserFederationProvider, KeycloakSession, RealmModel)`

    - #### createRoleQuery

          public LDAPQuery createRoleQuery()

    - #### getTargetRoleContainer

          protected RoleContainerModel getTargetRoleContainer()

    - #### createLDAPRole

          public LDAPObject createLDAPRole(String roleName)

    - #### addRoleMappingInLDAP

          public void addRoleMappingInLDAP(String roleName,
                                           LDAPObject ldapUser)

    - #### deleteRoleMappingInLDAP

          public void deleteRoleMappingInLDAP(LDAPObject ldapUser,
                                              LDAPObject ldapRole)

    - #### loadLDAPRoleByName

          public LDAPObject loadLDAPRoleByName(String roleName)

    - #### getLDAPRoleMappings

          protected List<LDAPObject> getLDAPRoleMappings(LDAPObject ldapUser)

    - #### proxy

          public UserModel proxy(LDAPObject ldapUser,
                                 UserModel delegate)

      Specified by:
        `proxy` in class `AbstractLDAPFederationMapper`
      See Also:
        `LDAPFederationMapper.proxy(UserFederationMapperModel, LDAPFederationProvider, LDAPObject, UserModel, RealmModel)`

    - #### beforeLDAPQuery

          public void beforeLDAPQuery(LDAPQuery query)

      Specified by:
        `beforeLDAPQuery` in class `AbstractLDAPFederationMapper`
      See Also:
        `LDAPFederationMapper.beforeLDAPQuery(UserFederationMapperModel, LDAPQuery)`

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