org.keycloak.models

## Interface UserFederationProvider

- All Superinterfaces:
    Provider
  All Known Implementing Classes:
    BasePropertiesFederationProvider, ClasspathPropertiesFederationProvider, DummyUserFederationProvider, FilePropertiesFederationProvider, LDAPFederationProvider

      public interface UserFederationProvider
      extends Provider

  SPI for plugging in federation storage.
  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static class` | `UserFederationProvider.EditMode` Optional type that can be by implementations to describe edit mode of federation storage

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `EMAIL`
    `static String` | `FIRST_NAME`
    `static String` | `LAST_NAME`
    `static String` | `USERNAME`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `close()`
    `Set<String>` | `getSupportedCredentialTypes(UserModel user)` What UserCredentialModel types should be handled by this provider for this user? Keycloak will only call validCredentials() with the credential types specified in this method.
    `UserModel` | `getUserByEmail(RealmModel realm, String email)` Required to import into local storage any user found.
    `UserModel` | `getUserByUsername(RealmModel realm, String username)` Required to import into local storage any user found.
    `boolean` | `isValid(UserModel local)` Is the Keycloak UserModel still valid and/or existing in federated storage?
    `void` | `preRemove(RealmModel realm)` called whenever a Realm is removed
    `void` | `preRemove(RealmModel realm, RoleModel role)` called before a role is removed.
    `UserModel` | `proxy(UserModel local)` Gives the provider an option to proxy UserModels loaded from local storage.
    `UserModel` | `register(RealmModel realm, UserModel user)` Called if this federation provider has priority and supports synchronized registrations.
    `boolean` | `removeUser(RealmModel realm, UserModel user)`
    `List<UserModel>` | `searchByAttributes(Map<String,String> attributes, RealmModel realm, int maxResults)` Required to import into local storage any user found.
    `boolean` | `synchronizeRegistrations()` Should user registrations be synchronized with this provider? FYI, only one provider will be chosen (by priority) to have this synchronization
    `boolean` | `validCredentials(RealmModel realm, UserModel user, List<UserCredentialModel> input)` Validate credentials for this user.
    `boolean` | `validCredentials(RealmModel realm, UserModel user, UserCredentialModel... input)`

- - ### Field Detail

    - #### USERNAME

          static final String USERNAME

      See Also:
        Constant Field Values

    - #### EMAIL

          static final String EMAIL

      See Also:
        Constant Field Values

    - #### FIRST_NAME

          static final String FIRST_NAME

      See Also:
        Constant Field Values

    - #### LAST_NAME

          static final String LAST_NAME

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### proxy

          UserModel proxy(UserModel local)

      Gives the provider an option to proxy UserModels loaded from local storage. This method is called whenever a UserModel is pulled from local storage. For example, the LDAP provider proxies the UserModel and does on-demand synchronization with LDAP whenever UserModel update methods are invoked. It also overrides UserModel.updateCredential for the credential types it supports
      Parameters:
        `local` -
      Returns:

    - #### synchronizeRegistrations

          boolean synchronizeRegistrations()

      Should user registrations be synchronized with this provider? FYI, only one provider will be chosen (by priority) to have this synchronization
      Returns:

    - #### register

          UserModel register(RealmModel realm,
                           UserModel user)

      Called if this federation provider has priority and supports synchronized registrations.
      Parameters:
        `realm` -
        `user` -
      Returns:

    - #### removeUser

          boolean removeUser(RealmModel realm,
                           UserModel user)

    - #### getUserByUsername

          UserModel getUserByUsername(RealmModel realm,
                                    String username)

      Required to import into local storage any user found.
      Parameters:
        `realm` -
        `username` -
      Returns:

    - #### getUserByEmail

          UserModel getUserByEmail(RealmModel realm,
                                 String email)

      Required to import into local storage any user found.
      Parameters:
        `realm` -
        `email` -
      Returns:

    - #### searchByAttributes

          List<UserModel> searchByAttributes(Map<String,String> attributes,
                                           RealmModel realm,
                                           int maxResults)

      Required to import into local storage any user found. Must not import if user already exists in KeycloakSession.userStorage()! Currently only attributes USERNAME, EMAIL, FIRST_NAME and LAST_NAME will be used.
      Parameters:
        `attributes` -
        `realm` -
      Returns:

    - #### preRemove

          void preRemove(RealmModel realm)

      called whenever a Realm is removed
      Parameters:
        `realm` -

    - #### preRemove

          void preRemove(RealmModel realm,
                       RoleModel role)

      called before a role is removed.
      Parameters:
        `realm` -
        `role` -

    - #### isValid

          boolean isValid(UserModel local)

      Is the Keycloak UserModel still valid and/or existing in federated storage?
      Parameters:
        `local` -
      Returns:

    - #### getSupportedCredentialTypes

          Set<String> getSupportedCredentialTypes(UserModel user)

      What UserCredentialModel types should be handled by this provider for this user? Keycloak will only call validCredentials() with the credential types specified in this method.
      Returns:

    - #### validCredentials

          boolean validCredentials(RealmModel realm,
                                 UserModel user,
                                 List<UserCredentialModel> input)

      Validate credentials for this user. This method will only be called with credential parameters supported by this provider
      Parameters:
        `realm` -
        `user` -
        `input` -
      Returns:

    - #### validCredentials

          boolean validCredentials(RealmModel realm,
                                 UserModel user,
                                 UserCredentialModel... input)

    - #### close

          void close()

      Specified by:
        `close` in interface `Provider`

Copyright © 2015. All Rights Reserved.