Class MapUserCredentialManager
- java.lang.Object
- 
- org.keycloak.models.map.credential.MapUserCredentialManager
 
- 
- All Implemented Interfaces:
- SubjectCredentialManager
 
 public class MapUserCredentialManager extends Object implements SubjectCredentialManager Handling credentials for a given user. This serves as a wrapper to specific strategies. The wrapping code implements the logic forCredentialInputUpdaters andCredentialInputValidators.- Author:
- Alexander Schwartz
 
- 
- 
Constructor SummaryConstructors Constructor Description MapUserCredentialManager(KeycloakSession session, RealmModel realm, UserModel user, MapUserEntity entity)
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description CredentialModelcreateCredentialThroughProvider(CredentialModel model)Deprecated.CredentialModelcreateStoredCredential(CredentialModel cred)Updates a credential of the entity with an updatedCredentialModel.voiddisableCredentialType(String credentialType)Disable a credential by type.Stream<String>getConfiguredUserStorageCredentialTypesStream()Deprecated.Stream<String>getDisableableCredentialTypesStream()List the credentials that can be disabled, for example, to show the list to the entity (aka user) or an admin.CredentialModelgetStoredCredentialById(String id)Read a stored credential.CredentialModelgetStoredCredentialByNameAndType(String name, String type)Stream<CredentialModel>getStoredCredentialsByTypeStream(String type)Read stored credentials by type as a stream.Stream<CredentialModel>getStoredCredentialsStream()Read stored credentials as a stream.booleanisConfiguredFor(String type)Check if the credential type is configured for this entity.booleanisConfiguredLocally(String type)Deprecated.booleanisValid(List<CredentialInput> inputs)Validate a list of credentials.booleanmoveStoredCredentialTo(String id, String newPreviousCredentialId)Re-order the stored credentials.booleanremoveStoredCredentialById(String id)Updates a credential of the entity with an updatedCredentialModel.booleanupdateCredential(CredentialInput input)Updates a credential of the entity with the inputs provided by the entity.voidupdateCredentialLabel(String credentialId, String userLabel)Update the label for a stored credentials chosen by the owner of the entity.voidupdateStoredCredential(CredentialModel cred)Updates a credential of the entity with an updatedCredentialModel.- 
Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 - 
Methods inherited from interface org.keycloak.models.SubjectCredentialManagerisValid
 
- 
 
- 
- 
- 
Constructor Detail- 
MapUserCredentialManagerpublic MapUserCredentialManager(KeycloakSession session, RealmModel realm, UserModel user, MapUserEntity entity) 
 
- 
 - 
Method Detail- 
isValidpublic boolean isValid(List<CredentialInput> inputs) Description copied from interface:SubjectCredentialManagerValidate a list of credentials.- Specified by:
- isValidin interface- SubjectCredentialManager
- Returns:
- trueif inputs are valid
 
 - 
updateCredentialpublic boolean updateCredential(CredentialInput input) Description copied from interface:SubjectCredentialManagerUpdates a credential of the entity with the inputs provided by the entity.- Specified by:
- updateCredentialin interface- SubjectCredentialManager
- Returns:
- trueif credentials have been updated successfully
 
 - 
updateStoredCredentialpublic void updateStoredCredential(CredentialModel cred) Description copied from interface:SubjectCredentialManagerUpdates a credential of the entity with an updatedCredentialModel. Usually called by aCredentialProvider.- Specified by:
- updateStoredCredentialin interface- SubjectCredentialManager
 
 - 
createStoredCredentialpublic CredentialModel createStoredCredential(CredentialModel cred) Description copied from interface:SubjectCredentialManagerUpdates a credential of the entity with an updatedCredentialModel. Usually called by aCredentialProvider.- Specified by:
- createStoredCredentialin interface- SubjectCredentialManager
 
 - 
removeStoredCredentialByIdpublic boolean removeStoredCredentialById(String id) Description copied from interface:SubjectCredentialManagerUpdates a credential of the entity with an updatedCredentialModel. Usually called by aCredentialProvider, or from the account management when a user removes, for example, an OTP token.- Specified by:
- removeStoredCredentialByIdin interface- SubjectCredentialManager
 
 - 
getStoredCredentialByIdpublic CredentialModel getStoredCredentialById(String id) Description copied from interface:SubjectCredentialManagerRead a stored credential.- Specified by:
- getStoredCredentialByIdin interface- SubjectCredentialManager
 
 - 
getStoredCredentialsStreampublic Stream<CredentialModel> getStoredCredentialsStream() Description copied from interface:SubjectCredentialManagerRead stored credentials as a stream.- Specified by:
- getStoredCredentialsStreamin interface- SubjectCredentialManager
 
 - 
getStoredCredentialsByTypeStreampublic Stream<CredentialModel> getStoredCredentialsByTypeStream(String type) Description copied from interface:SubjectCredentialManagerRead stored credentials by type as a stream.- Specified by:
- getStoredCredentialsByTypeStreamin interface- SubjectCredentialManager
 
 - 
getStoredCredentialByNameAndTypepublic CredentialModel getStoredCredentialByNameAndType(String name, String type) - Specified by:
- getStoredCredentialByNameAndTypein interface- SubjectCredentialManager
 
 - 
moveStoredCredentialTopublic boolean moveStoredCredentialTo(String id, String newPreviousCredentialId) Description copied from interface:SubjectCredentialManagerRe-order the stored credentials.- Specified by:
- moveStoredCredentialToin interface- SubjectCredentialManager
 
 - 
updateCredentialLabelpublic void updateCredentialLabel(String credentialId, String userLabel) Description copied from interface:SubjectCredentialManagerUpdate the label for a stored credentials chosen by the owner of the entity.- Specified by:
- updateCredentialLabelin interface- SubjectCredentialManager
 
 - 
disableCredentialTypepublic void disableCredentialType(String credentialType) Description copied from interface:SubjectCredentialManagerDisable a credential by type.- Specified by:
- disableCredentialTypein interface- SubjectCredentialManager
 
 - 
getDisableableCredentialTypesStreampublic Stream<String> getDisableableCredentialTypesStream() Description copied from interface:SubjectCredentialManagerList the credentials that can be disabled, for example, to show the list to the entity (aka user) or an admin.- Specified by:
- getDisableableCredentialTypesStreamin interface- SubjectCredentialManager
- Returns:
- stream with credential types that can be disabled
 
 - 
isConfiguredForpublic boolean isConfiguredFor(String type) Description copied from interface:SubjectCredentialManagerCheck if the credential type is configured for this entity.- Specified by:
- isConfiguredForin interface- SubjectCredentialManager
- Parameters:
- type- credential type to check
- Returns:
- trueif the credential type has been
 
 - 
isConfiguredLocally@Deprecated public boolean isConfiguredLocally(String type) Deprecated.- Specified by:
- isConfiguredLocallyin interface- SubjectCredentialManager
 
 - 
getConfiguredUserStorageCredentialTypesStream@Deprecated public Stream<String> getConfiguredUserStorageCredentialTypesStream() Deprecated.- Specified by:
- getConfiguredUserStorageCredentialTypesStreamin interface- SubjectCredentialManager
 
 - 
createCredentialThroughProvider@Deprecated public CredentialModel createCredentialThroughProvider(CredentialModel model) Deprecated.- Specified by:
- createCredentialThroughProviderin interface- SubjectCredentialManager
 
 
- 
 
-