org.keycloak.credential

## Interface UserCredentialStore

- All Superinterfaces:
    Provider
  All Known Subinterfaces:
    UserCredentialManager, UserCredentialManager.Streams, UserCredentialStore.Streams
  All Known Implementing Classes:
    JpaUserCredentialStore, JpaUserFederatedStorageProvider, JpaUserProvider, MapUserProvider, UserCredentialStoreManager

      public interface UserCredentialStore
      extends Provider

  Version:
    $Revision: 1 $
  Author:
    Bill Burke

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `UserCredentialStore.Streams` The `UserCredentialStore.Streams` interface makes all collection-based methods in `UserCredentialStore` default by providing implementations that delegate to the `Stream`-based variants instead of the other way around.

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `CredentialModel` | `createCredential(RealmModel realm, UserModel user, CredentialModel cred)`
    `CredentialModel` | `getStoredCredentialById(RealmModel realm, UserModel user, String id)`
    `CredentialModel` | `getStoredCredentialByNameAndType(RealmModel realm, UserModel user, String name, String type)`
    `List<CredentialModel>` | `getStoredCredentials(RealmModel realm, UserModel user)` Deprecated. Use `getStoredCredentialsStream` instead.
    `List<CredentialModel>` | `getStoredCredentialsByType(RealmModel realm, UserModel user, String type)` Deprecated. Use `getStoredCredentialsByTypeStream` instead.
    `default Stream<CredentialModel>` | `getStoredCredentialsByTypeStream(RealmModel realm, UserModel user, String type)` Obtains the stored credentials associated with the specified user that match the specified type.
    `default Stream<CredentialModel>` | `getStoredCredentialsStream(RealmModel realm, UserModel user)` Obtains the stored credentials associated with the specified user.
    `boolean` | `moveCredentialTo(RealmModel realm, UserModel user, String id, String newPreviousCredentialId)`
    `boolean` | `removeStoredCredential(RealmModel realm, UserModel user, String id)`
    `void` | `updateCredential(RealmModel realm, UserModel user, CredentialModel cred)`

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

      `close`

- - ### Method Detail

    - #### updateCredential

          void updateCredential(RealmModel realm,
                                UserModel user,
                                CredentialModel cred)

    - #### createCredential

          CredentialModel createCredential(RealmModel realm,
                                           UserModel user,
                                           CredentialModel cred)

    - #### removeStoredCredential

          boolean removeStoredCredential(RealmModel realm,
                                         UserModel user,
                                         String id)

    - #### getStoredCredentialById

          CredentialModel getStoredCredentialById(RealmModel realm,
                                                  UserModel user,
                                                  String id)

    - #### getStoredCredentials

          @Deprecated
          List<CredentialModel> getStoredCredentials(RealmModel realm,
                                                                 UserModel user)

      Deprecated. Use `getStoredCredentialsStream` instead.

    - #### getStoredCredentialsStream

          default Stream<CredentialModel> getStoredCredentialsStream(RealmModel realm,
                                                                     UserModel user)

      Obtains the stored credentials associated with the specified user.
      Parameters:
        `realm` - a reference to the realm.
        `user` - the user whose credentials are being searched.
      Returns:
        a non-null `Stream` of credentials.

    - #### getStoredCredentialsByType

          @Deprecated
          List<CredentialModel> getStoredCredentialsByType(RealmModel realm,
                                                                       UserModel user,
                                                                       String type)

      Deprecated. Use `getStoredCredentialsByTypeStream` instead.

    - #### getStoredCredentialsByTypeStream

          default Stream<CredentialModel> getStoredCredentialsByTypeStream(RealmModel realm,
                                                                           UserModel user,
                                                                           String type)

      Obtains the stored credentials associated with the specified user that match the specified type.
      Parameters:
        `realm` - a reference to the realm.
        `user` - the user whose credentials are being searched.
        `type` - the type of credentials being searched.
      Returns:
        a non-null `Stream` of credentials.

    - #### getStoredCredentialByNameAndType

          CredentialModel getStoredCredentialByNameAndType(RealmModel realm,
                                                           UserModel user,
                                                           String name,
                                                           String type)

    - #### moveCredentialTo

          boolean moveCredentialTo(RealmModel realm,
                                   UserModel user,
                                   String id,
                                   String newPreviousCredentialId)

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