org.keycloak.models

## Interface UserProvider

- All Superinterfaces:
    Provider, UserCredentialValidatorProvider, UserLookupProvider, UserQueryProvider, UserRegistrationProvider
  All Known Subinterfaces:
    CacheUserProvider
  All Known Implementing Classes:
    JpaUserProvider, MongoUserProvider, UserCacheSession, UserFederationManager, UserStorageManager

      public interface UserProvider
      extends Provider, UserLookupProvider, UserQueryProvider, UserCredentialValidatorProvider, UserRegistrationProvider

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `addConsent(RealmModel realm, UserModel user, UserConsentModel consent)`
    `void` | `addFederatedIdentity(RealmModel realm, UserModel user, FederatedIdentityModel socialLink)`
    `UserModel` | `addUser(RealmModel realm, String id, String username, boolean addDefaultRoles, boolean addDefaultRequiredActions)` only used for local storage
    `void` | `close()`
    `UserConsentModel` | `getConsentByClient(RealmModel realm, UserModel user, String clientInternalId)`
    `List<UserConsentModel>` | `getConsents(RealmModel realm, UserModel user)`
    `Set<FederatedIdentityModel>` | `getFederatedIdentities(UserModel user, RealmModel realm)`
    `FederatedIdentityModel` | `getFederatedIdentity(UserModel user, String socialProvider, RealmModel realm)`
    `UserModel` | `getServiceAccount(ClientModel client)`
    `UserModel` | `getUserByFederatedIdentity(FederatedIdentityModel socialLink, RealmModel realm)`
    `List<UserModel>` | `getUsers(RealmModel realm, boolean includeServiceAccounts)`
    `List<UserModel>` | `getUsers(RealmModel realm, int firstResult, int maxResults, boolean includeServiceAccounts)`
    `void` | `preRemove(ProtocolMapperModel protocolMapper)`
    `void` | `preRemove(RealmModel realm)`
    `void` | `preRemove(RealmModel realm, ClientModel client)`
    `void` | `preRemove(RealmModel realm, ComponentModel component)`
    `void` | `preRemove(RealmModel realm, GroupModel group)`
    `void` | `preRemove(RealmModel realm, RoleModel role)`
    `void` | `preRemove(RealmModel realm, UserFederationProviderModel link)`
    `boolean` | `removeFederatedIdentity(RealmModel realm, UserModel user, String socialProvider)`
    `boolean` | `revokeConsentForClient(RealmModel realm, UserModel user, String clientInternalId)`
    `void` | `updateConsent(RealmModel realm, UserModel user, UserConsentModel consent)`
    `void` | `updateFederatedIdentity(RealmModel realm, UserModel federatedUser, FederatedIdentityModel federatedIdentityModel)`
    `CredentialValidationOutput` | `validCredentials(KeycloakSession session, RealmModel realm, UserCredentialModel... input)`
    `boolean` | `validCredentials(KeycloakSession session, RealmModel realm, UserModel user, UserCredentialModel... input)`

    - ### Methods inherited from interface org.keycloak.storage.user.UserLookupProvider

      `getUserByEmail, getUserById, getUserByUsername`

    - ### Methods inherited from interface org.keycloak.storage.user.UserQueryProvider

      `getGroupMembers, getGroupMembers, getUsers, getUsers, getUsersCount, searchForUser, searchForUser, searchForUser, searchForUser, searchForUserByUserAttribute`

    - ### Methods inherited from interface org.keycloak.storage.user.UserCredentialValidatorProvider

      `validCredentials`

    - ### Methods inherited from interface org.keycloak.storage.user.UserRegistrationProvider

      `addUser, grantToAllUsers, removeUser`

- - ### Method Detail

    - #### addFederatedIdentity

          void addFederatedIdentity(RealmModel realm,
                                    UserModel user,
                                    FederatedIdentityModel socialLink)

    - #### removeFederatedIdentity

          boolean removeFederatedIdentity(RealmModel realm,
                                          UserModel user,
                                          String socialProvider)

    - #### updateFederatedIdentity

          void updateFederatedIdentity(RealmModel realm,
                                       UserModel federatedUser,
                                       FederatedIdentityModel federatedIdentityModel)

    - #### getFederatedIdentities

          Set<FederatedIdentityModel> getFederatedIdentities(UserModel user,
                                                             RealmModel realm)

    - #### getFederatedIdentity

          FederatedIdentityModel getFederatedIdentity(UserModel user,
                                                      String socialProvider,
                                                      RealmModel realm)

    - #### getUserByFederatedIdentity

          UserModel getUserByFederatedIdentity(FederatedIdentityModel socialLink,
                                               RealmModel realm)

    - #### addConsent

          void addConsent(RealmModel realm,
                          UserModel user,
                          UserConsentModel consent)

    - #### getConsentByClient

          UserConsentModel getConsentByClient(RealmModel realm,
                                              UserModel user,
                                              String clientInternalId)

    - #### getConsents

          List<UserConsentModel> getConsents(RealmModel realm,
                                             UserModel user)

    - #### updateConsent

          void updateConsent(RealmModel realm,
                             UserModel user,
                             UserConsentModel consent)

    - #### revokeConsentForClient

          boolean revokeConsentForClient(RealmModel realm,
                                         UserModel user,
                                         String clientInternalId)

    - #### getServiceAccount

          UserModel getServiceAccount(ClientModel client)

    - #### getUsers

          List<UserModel> getUsers(RealmModel realm,
                                   boolean includeServiceAccounts)

    - #### getUsers

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

    - #### addUser

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

      only used for local storage
      Parameters:
        `realm` -
        `id` -
        `username` -
        `addDefaultRoles` -
        `addDefaultRequiredActions` -
      Returns:

    - #### preRemove

          void preRemove(RealmModel realm)

    - #### preRemove

          void preRemove(RealmModel realm,
                         UserFederationProviderModel link)

    - #### preRemove

          void preRemove(RealmModel realm,
                         RoleModel role)

    - #### preRemove

          void preRemove(RealmModel realm,
                         GroupModel group)

    - #### preRemove

          void preRemove(RealmModel realm,
                         ClientModel client)

    - #### preRemove

          void preRemove(ProtocolMapperModel protocolMapper)

    - #### validCredentials

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

    - #### validCredentials

          CredentialValidationOutput validCredentials(KeycloakSession session,
                                                      RealmModel realm,
                                                      UserCredentialModel... input)

    - #### close

          void close()

      Specified by:
        `close` in interface `Provider`

    - #### preRemove

          void preRemove(RealmModel realm,
                         ComponentModel component)

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