Package org.keycloak.models
Interface SubjectCredentialManager
-
- All Known Implementing Classes:
LegacyUserCredentialManager
,MapUserCredentialManager
,SubjectCredentialManagerCacheAdapter
public interface SubjectCredentialManager
Validates and manages the credentials of a known entity (for example, a user).
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description CredentialModel
createCredentialThroughProvider(CredentialModel model)
Deprecated.CredentialModel
createStoredCredential(CredentialModel cred)
Updates a credential of the entity with an updatedCredentialModel
.void
disableCredentialType(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.CredentialModel
getStoredCredentialById(String id)
Read a stored credential.CredentialModel
getStoredCredentialByNameAndType(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.boolean
isConfiguredFor(String type)
Check if the credential type is configured for this entity.boolean
isConfiguredLocally(String type)
Deprecated.boolean
isValid(List<CredentialInput> inputs)
Validate a list of credentials.default boolean
isValid(CredentialInput... inputs)
Validate a list of credentials.boolean
moveStoredCredentialTo(String id, String newPreviousCredentialId)
Re-order the stored credentials.boolean
removeStoredCredentialById(String id)
Updates a credential of the entity with an updatedCredentialModel
.boolean
updateCredential(CredentialInput input)
Updates a credential of the entity with the inputs provided by the entity.void
updateCredentialLabel(String credentialId, String credentialLabel)
Update the label for a stored credentials chosen by the owner of the entity.void
updateStoredCredential(CredentialModel cred)
Updates a credential of the entity with an updatedCredentialModel
.
-
-
-
Method Detail
-
isValid
boolean isValid(List<CredentialInput> inputs)
Validate a list of credentials.- Returns:
true
if inputs are valid
-
isValid
default boolean isValid(CredentialInput... inputs)
Validate a list of credentials.- Returns:
true
if inputs are valid
-
updateCredential
boolean updateCredential(CredentialInput input)
Updates a credential of the entity with the inputs provided by the entity.- Returns:
true
if credentials have been updated successfully
-
updateStoredCredential
void updateStoredCredential(CredentialModel cred)
Updates a credential of the entity with an updatedCredentialModel
. Usually called by aCredentialProvider
.
-
createStoredCredential
CredentialModel createStoredCredential(CredentialModel cred)
Updates a credential of the entity with an updatedCredentialModel
. Usually called by aCredentialProvider
.
-
removeStoredCredentialById
boolean removeStoredCredentialById(String id)
Updates 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.
-
getStoredCredentialById
CredentialModel getStoredCredentialById(String id)
Read a stored credential.
-
getStoredCredentialsStream
Stream<CredentialModel> getStoredCredentialsStream()
Read stored credentials as a stream.
-
getStoredCredentialsByTypeStream
Stream<CredentialModel> getStoredCredentialsByTypeStream(String type)
Read stored credentials by type as a stream.
-
getStoredCredentialByNameAndType
CredentialModel getStoredCredentialByNameAndType(String name, String type)
-
moveStoredCredentialTo
boolean moveStoredCredentialTo(String id, String newPreviousCredentialId)
Re-order the stored credentials.
-
updateCredentialLabel
void updateCredentialLabel(String credentialId, String credentialLabel)
Update the label for a stored credentials chosen by the owner of the entity.
-
disableCredentialType
void disableCredentialType(String credentialType)
Disable a credential by type.
-
getDisableableCredentialTypesStream
Stream<String> getDisableableCredentialTypesStream()
List the credentials that can be disabled, for example, to show the list to the entity (aka user) or an admin.- Returns:
- stream with credential types that can be disabled
-
isConfiguredFor
boolean isConfiguredFor(String type)
Check if the credential type is configured for this entity.- Parameters:
type
- credential type to check- Returns:
true
if the credential type has been
-
isConfiguredLocally
@Deprecated boolean isConfiguredLocally(String type)
Deprecated.
-
getConfiguredUserStorageCredentialTypesStream
@Deprecated Stream<String> getConfiguredUserStorageCredentialTypesStream()
Deprecated.
-
createCredentialThroughProvider
@Deprecated CredentialModel createCredentialThroughProvider(CredentialModel model)
Deprecated.
-
-