org.keycloak.broker.provider

## Class AbstractIdentityProviderMapper

- java.lang.Object
- - org.keycloak.broker.provider.AbstractIdentityProviderMapper

- All Implemented Interfaces:
    IdentityProviderMapper, ConfiguredProvider, Provider, ProviderFactory<IdentityProviderMapper>
  Direct Known Subclasses:
    AbstractClaimMapper, AbstractJsonUserAttributeMapper, AttributeToRoleMapper, HardcodedAttributeMapper, HardcodedRoleMapper, HardcodedUserSessionAttributeMapper, UserAttributeMapper, UsernameTemplateMapper

      public abstract class AbstractIdentityProviderMapper
      extends Object
      implements IdentityProviderMapper

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    - ### Fields inherited from interface org.keycloak.broker.provider.IdentityProviderMapper

      `ANY_PROVIDER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `AbstractIdentityProviderMapper()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()` This is called when the server shuts down.
    `IdentityProviderMapper` | `create(KeycloakSession session)`
    `void` | `importNewUser(KeycloakSession session, RealmModel realm, UserModel user, IdentityProviderMapperModel mapperModel, BrokeredIdentityContext context)` Called after UserModel is created for first time for this user.
    `void` | `init(Config.Scope config)` Only called once when the factory is first created.
    `void` | `postInit(KeycloakSessionFactory factory)` Called after all provider factories have been initialized
    `void` | `preprocessFederatedIdentity(KeycloakSession session, RealmModel realm, IdentityProviderMapperModel mapperModel, BrokeredIdentityContext context)` Called to determine what keycloak username and email to use to process the login request from the external IDP.

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

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

    - ### Methods inherited from interface org.keycloak.broker.provider.IdentityProviderMapper

      `getCompatibleProviders, getDisplayCategory, getDisplayType, updateBrokeredUser`

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

      `getId`

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

      `getConfigProperties, getHelpText`

- - ### Constructor Detail

    - #### AbstractIdentityProviderMapper

          public AbstractIdentityProviderMapper()

  - ### Method Detail

    - #### close

          public void close()

      Description copied from interface: `ProviderFactory`
      This is called when the server shuts down.
      Specified by:
        `close` in interface `Provider`
      Specified by:
        `close` in interface `ProviderFactory<IdentityProviderMapper>`

    - #### create

          public IdentityProviderMapper create(KeycloakSession session)

      Specified by:
        `create` in interface `ProviderFactory<IdentityProviderMapper>`

    - #### init

          public void init(Config.Scope config)

      Description copied from interface: `ProviderFactory`
      Only called once when the factory is first created. This config is pulled from keycloak_server.json
      Specified by:
        `init` in interface `ProviderFactory<IdentityProviderMapper>`

    - #### postInit

          public void postInit(KeycloakSessionFactory factory)

      Description copied from interface: `ProviderFactory`
      Called after all provider factories have been initialized
      Specified by:
        `postInit` in interface `ProviderFactory<IdentityProviderMapper>`

    - #### preprocessFederatedIdentity

          public void preprocessFederatedIdentity(KeycloakSession session,
                                                  RealmModel realm,
                                                  IdentityProviderMapperModel mapperModel,
                                                  BrokeredIdentityContext context)

      Description copied from interface: `IdentityProviderMapper`
      Called to determine what keycloak username and email to use to process the login request from the external IDP. It's called before "FirstBrokerLogin" flow, so can be used to map attributes to BrokeredIdentityContext ( BrokeredIdentityContext.setUserAttribute ), which will be available on "Review Profile" page and in authenticators during FirstBrokerLogin flow
      Specified by:
        `preprocessFederatedIdentity` in interface `IdentityProviderMapper`

    - #### importNewUser

          public void importNewUser(KeycloakSession session,
                                    RealmModel realm,
                                    UserModel user,
                                    IdentityProviderMapperModel mapperModel,
                                    BrokeredIdentityContext context)

      Description copied from interface: `IdentityProviderMapper`
      Called after UserModel is created for first time for this user. Called after "FirstBrokerLogin" flow
      Specified by:
        `importNewUser` in interface `IdentityProviderMapper`

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