org.keycloak.models

## Class UserFederationManager

- java.lang.Object
- - org.keycloak.models.UserFederationManager

- All Implemented Interfaces:
    UserProvider, Provider

      public class UserFederationManager
      extends Object
      implements UserProvider

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected KeycloakSession` | `session`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `UserFederationManager(KeycloakSession session)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addSocialLink(RealmModel realm, UserModel user, SocialLinkModel socialLink)`
    `UserModel` | `addUser(RealmModel realm, String username)`
    `UserModel` | `addUser(RealmModel realm, String id, String username, boolean addDefaultRoles)`
    `void` | `close()`
    `protected void` | `deleteInvalidUser(RealmModel realm, UserModel user)`
    `protected UserFederationProvider` | `getFederationLink(RealmModel realm, UserModel user)`
    `protected UserFederationProvider` | `getFederationProvider(UserFederationProviderModel model)`
    `SocialLinkModel` | `getSocialLink(UserModel user, String socialProvider, RealmModel realm)`
    `Set<SocialLinkModel>` | `getSocialLinks(UserModel user, RealmModel realm)`
    `UserModel` | `getUserByEmail(String email, RealmModel realm)`
    `UserModel` | `getUserById(String id, RealmModel realm)`
    `UserModel` | `getUserBySocialLink(SocialLinkModel socialLink, RealmModel realm)`
    `UserModel` | `getUserByUsername(String username, RealmModel realm)`
    `List<UserModel>` | `getUsers(RealmModel realm)`
    `List<UserModel>` | `getUsers(RealmModel realm, int firstResult, int maxResults)`
    `int` | `getUsersCount(RealmModel realm)`
    `protected boolean` | `isValid(RealmModel realm, UserModel user)`
    `void` | `preRemove(RealmModel realm)`
    `void` | `preRemove(RealmModel realm, RoleModel role)`
    `void` | `preRemove(RealmModel realm, UserFederationProviderModel model)`
    `protected List<UserModel>` | `query(org.keycloak.models.UserFederationManager.PaginatedQuery pagedQuery, RealmModel realm, int firstResult, int maxResults)`
    `protected UserModel` | `registerWithFederation(RealmModel realm, UserModel user)`
    `boolean` | `removeSocialLink(RealmModel realm, UserModel user, String socialProvider)`
    `boolean` | `removeUser(RealmModel realm, UserModel user)`
    `List<UserModel>` | `searchForUser(String search, RealmModel realm)`
    `List<UserModel>` | `searchForUser(String search, RealmModel realm, int firstResult, int maxResults)`
    `List<UserModel>` | `searchForUserByAttributes(Map<String,String> attributes, RealmModel realm)`
    `List<UserModel>` | `searchForUserByAttributes(Map<String,String> attributes, RealmModel realm, int firstResult, int maxResults)`
    `void` | `updateCredential(RealmModel realm, UserModel user, UserCredentialModel credential)`
    `protected UserModel` | `validateAndProxyUser(RealmModel realm, UserModel user)`
    `protected void` | `validateUser(RealmModel realm, UserModel user)`
    `boolean` | `validCredentials(RealmModel realm, UserModel user, List<UserCredentialModel> input)`
    `boolean` | `validCredentials(RealmModel realm, UserModel user, UserCredentialModel... input)`

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

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

- - ### Field Detail

    - #### session

          protected KeycloakSession session

  - ### Constructor Detail

    - #### UserFederationManager

          public UserFederationManager(KeycloakSession session)

  - ### Method Detail

    - #### addUser

          public UserModel addUser(RealmModel realm,
                          String id,
                          String username,
                          boolean addDefaultRoles)

      Specified by:
        `addUser` in interface `UserProvider`

    - #### getFederationProvider

          protected UserFederationProvider getFederationProvider(UserFederationProviderModel model)

    - #### addUser

          public UserModel addUser(RealmModel realm,
                          String username)

      Specified by:
        `addUser` in interface `UserProvider`

    - #### registerWithFederation

          protected UserModel registerWithFederation(RealmModel realm,
                                         UserModel user)

    - #### getFederationLink

          protected UserFederationProvider getFederationLink(RealmModel realm,
                                                 UserModel user)

    - #### removeUser

          public boolean removeUser(RealmModel realm,
                           UserModel user)

      Specified by:
        `removeUser` in interface `UserProvider`

    - #### validateUser

          protected void validateUser(RealmModel realm,
                          UserModel user)

    - #### deleteInvalidUser

          protected void deleteInvalidUser(RealmModel realm,
                               UserModel user)

    - #### isValid

          protected boolean isValid(RealmModel realm,
                        UserModel user)

    - #### validateAndProxyUser

          protected UserModel validateAndProxyUser(RealmModel realm,
                                       UserModel user)

    - #### addSocialLink

          public void addSocialLink(RealmModel realm,
                           UserModel user,
                           SocialLinkModel socialLink)

      Specified by:
        `addSocialLink` in interface `UserProvider`

    - #### removeSocialLink

          public boolean removeSocialLink(RealmModel realm,
                                 UserModel user,
                                 String socialProvider)

      Specified by:
        `removeSocialLink` in interface `UserProvider`

    - #### getUserById

          public UserModel getUserById(String id,
                              RealmModel realm)

      Specified by:
        `getUserById` in interface `UserProvider`

    - #### getUserByUsername

          public UserModel getUserByUsername(String username,
                                    RealmModel realm)

      Specified by:
        `getUserByUsername` in interface `UserProvider`

    - #### getUserByEmail

          public UserModel getUserByEmail(String email,
                                 RealmModel realm)

      Specified by:
        `getUserByEmail` in interface `UserProvider`

    - #### getUserBySocialLink

          public UserModel getUserBySocialLink(SocialLinkModel socialLink,
                                      RealmModel realm)

      Specified by:
        `getUserBySocialLink` in interface `UserProvider`

    - #### getUsers

          public List<UserModel> getUsers(RealmModel realm)

      Specified by:
        `getUsers` in interface `UserProvider`

    - #### getUsersCount

          public int getUsersCount(RealmModel realm)

      Specified by:
        `getUsersCount` in interface `UserProvider`

    - #### query

          protected List<UserModel> query(org.keycloak.models.UserFederationManager.PaginatedQuery pagedQuery,
                              RealmModel realm,
                              int firstResult,
                              int maxResults)

    - #### getUsers

          public List<UserModel> getUsers(RealmModel realm,
                                 int firstResult,
                                 int maxResults)

      Specified by:
        `getUsers` in interface `UserProvider`

    - #### searchForUser

          public List<UserModel> searchForUser(String search,
                                      RealmModel realm)

      Specified by:
        `searchForUser` in interface `UserProvider`

    - #### searchForUser

          public List<UserModel> searchForUser(String search,
                                      RealmModel realm,
                                      int firstResult,
                                      int maxResults)

      Specified by:
        `searchForUser` in interface `UserProvider`

    - #### searchForUserByAttributes

          public List<UserModel> searchForUserByAttributes(Map<String,String> attributes,
                                                  RealmModel realm)

      Specified by:
        `searchForUserByAttributes` in interface `UserProvider`

    - #### searchForUserByAttributes

          public List<UserModel> searchForUserByAttributes(Map<String,String> attributes,
                                                  RealmModel realm,
                                                  int firstResult,
                                                  int maxResults)

      Specified by:
        `searchForUserByAttributes` in interface `UserProvider`

    - #### getSocialLinks

          public Set<SocialLinkModel> getSocialLinks(UserModel user,
                                            RealmModel realm)

      Specified by:
        `getSocialLinks` in interface `UserProvider`

    - #### getSocialLink

          public SocialLinkModel getSocialLink(UserModel user,
                                      String socialProvider,
                                      RealmModel realm)

      Specified by:
        `getSocialLink` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                       UserFederationProviderModel model)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### preRemove

          public void preRemove(RealmModel realm,
                       RoleModel role)

      Specified by:
        `preRemove` in interface `UserProvider`

    - #### updateCredential

          public void updateCredential(RealmModel realm,
                              UserModel user,
                              UserCredentialModel credential)

    - #### validCredentials

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

      Specified by:
        `validCredentials` in interface `UserProvider`

    - #### validCredentials

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

      Specified by:
        `validCredentials` in interface `UserProvider`

    - #### close

          public void close()

      Specified by:
        `close` in interface `UserProvider`
      Specified by:
        `close` in interface `Provider`

Copyright © 2015. All Rights Reserved.