Class MapUserCredentialManager
java.lang.Object
org.keycloak.models.map.credential.MapUserCredentialManager
- All Implemented Interfaces:
SubjectCredentialManager
Handling credentials for a given user.
This serves as a wrapper to specific strategies. The wrapping code implements the logic for
CredentialInputUpdaters
and CredentialInputValidators.- Author:
- Alexander Schwartz
-
Constructor Summary
ConstructorsConstructorDescriptionMapUserCredentialManager(KeycloakSession session, RealmModel realm, UserModel user, MapUserEntity entity) -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.Updates a credential of the entity with an updatedCredentialModel.voiddisableCredentialType(String credentialType) Disable a credential by type.Deprecated.List the credentials that can be disabled, for example, to show the list to the entity (aka user) or an admin.Read a stored credential.getStoredCredentialByNameAndType(String name, String type) Read stored credentials by type as a stream.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.booleanUpdates 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.voidUpdates a credential of the entity with an updatedCredentialModel.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.keycloak.models.SubjectCredentialManager
isValid
-
Constructor Details
-
MapUserCredentialManager
public MapUserCredentialManager(KeycloakSession session, RealmModel realm, UserModel user, MapUserEntity entity)
-
-
Method Details
-
isValid
Description copied from interface:SubjectCredentialManagerValidate a list of credentials.- Specified by:
isValidin interfaceSubjectCredentialManager- Returns:
trueif inputs are valid
-
updateCredential
Description copied from interface:SubjectCredentialManagerUpdates a credential of the entity with the inputs provided by the entity.- Specified by:
updateCredentialin interfaceSubjectCredentialManager- Returns:
trueif credentials have been updated successfully
-
updateStoredCredential
Description copied from interface:SubjectCredentialManagerUpdates a credential of the entity with an updatedCredentialModel. Usually called by aCredentialProvider.- Specified by:
updateStoredCredentialin interfaceSubjectCredentialManager
-
createStoredCredential
Description copied from interface:SubjectCredentialManagerUpdates a credential of the entity with an updatedCredentialModel. Usually called by aCredentialProvider.- Specified by:
createStoredCredentialin interfaceSubjectCredentialManager
-
removeStoredCredentialById
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 interfaceSubjectCredentialManager
-
getStoredCredentialById
Description copied from interface:SubjectCredentialManagerRead a stored credential.- Specified by:
getStoredCredentialByIdin interfaceSubjectCredentialManager
-
getStoredCredentialsStream
Description copied from interface:SubjectCredentialManagerRead stored credentials as a stream.- Specified by:
getStoredCredentialsStreamin interfaceSubjectCredentialManager
-
getStoredCredentialsByTypeStream
Description copied from interface:SubjectCredentialManagerRead stored credentials by type as a stream.- Specified by:
getStoredCredentialsByTypeStreamin interfaceSubjectCredentialManager
-
getStoredCredentialByNameAndType
- Specified by:
getStoredCredentialByNameAndTypein interfaceSubjectCredentialManager
-
moveStoredCredentialTo
Description copied from interface:SubjectCredentialManagerRe-order the stored credentials.- Specified by:
moveStoredCredentialToin interfaceSubjectCredentialManager
-
updateCredentialLabel
Description copied from interface:SubjectCredentialManagerUpdate the label for a stored credentials chosen by the owner of the entity.- Specified by:
updateCredentialLabelin interfaceSubjectCredentialManager
-
disableCredentialType
Description copied from interface:SubjectCredentialManagerDisable a credential by type.- Specified by:
disableCredentialTypein interfaceSubjectCredentialManager
-
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 interfaceSubjectCredentialManager- Returns:
- stream with credential types that can be disabled
-
isConfiguredFor
Description copied from interface:SubjectCredentialManagerCheck if the credential type is configured for this entity.- Specified by:
isConfiguredForin interfaceSubjectCredentialManager- Parameters:
type- credential type to check- Returns:
trueif the credential type has been
-
isConfiguredLocally
Deprecated.- Specified by:
isConfiguredLocallyin interfaceSubjectCredentialManager
-
getConfiguredUserStorageCredentialTypesStream
Deprecated.- Specified by:
getConfiguredUserStorageCredentialTypesStreamin interfaceSubjectCredentialManager
-
createCredentialThroughProvider
Deprecated.- Specified by:
createCredentialThroughProviderin interfaceSubjectCredentialManager
-