Package org.keycloak.credential
Class PasswordCredentialProvider
java.lang.Object
org.keycloak.credential.PasswordCredentialProvider
- All Implemented Interfaces:
CredentialInputUpdater
,CredentialInputValidator
,CredentialProvider<PasswordCredentialModel>
,Provider
public class PasswordCredentialProvider
extends Object
implements CredentialProvider<PasswordCredentialModel>, CredentialInputUpdater, CredentialInputValidator
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
createCredential
(RealmModel realm, UserModel user, String password) createCredential
(RealmModel realm, UserModel user, PasswordCredentialModel credentialModel) boolean
deleteCredential
(RealmModel realm, UserModel user, String credentialId) void
disableCredentialType
(RealmModel realm, UserModel user, String credentialType) getCredentialTypeMetadata
(CredentialTypeMetadataContext metadataContext) getDisableableCredentialTypesStream
(RealmModel realm, UserModel user) Obtains the set of credential types that can be disabled viadisableCredentialType
.protected PasswordHashProvider
getHashProvider
(PasswordPolicy policy) getPassword
(RealmModel realm, UserModel user) getType()
boolean
isConfiguredFor
(RealmModel realm, UserModel user, String credentialType) boolean
isValid
(RealmModel realm, UserModel user, CredentialInput input) Tests whether a credential is validboolean
supportsCredentialType
(String credentialType) boolean
updateCredential
(RealmModel realm, UserModel user, CredentialInput input) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.keycloak.credential.CredentialProvider
close, getCredentialMetadata, getDefaultCredential
-
Field Details
-
session
-
-
Constructor Details
-
PasswordCredentialProvider
-
-
Method Details
-
getPassword
-
createCredential
-
createCredential
public CredentialModel createCredential(RealmModel realm, UserModel user, PasswordCredentialModel credentialModel) - Specified by:
createCredential
in interfaceCredentialProvider<PasswordCredentialModel>
-
deleteCredential
- Specified by:
deleteCredential
in interfaceCredentialProvider<PasswordCredentialModel>
-
getCredentialFromModel
- Specified by:
getCredentialFromModel
in interfaceCredentialProvider<PasswordCredentialModel>
-
getHashProvider
-
supportsCredentialType
- Specified by:
supportsCredentialType
in interfaceCredentialInputUpdater
- Specified by:
supportsCredentialType
in interfaceCredentialInputValidator
-
updateCredential
- Specified by:
updateCredential
in interfaceCredentialInputUpdater
-
disableCredentialType
- Specified by:
disableCredentialType
in interfaceCredentialInputUpdater
-
getDisableableCredentialTypesStream
Description copied from interface:CredentialInputUpdater
Obtains the set of credential types that can be disabled viadisableCredentialType
.- Specified by:
getDisableableCredentialTypesStream
in interfaceCredentialInputUpdater
- Parameters:
realm
- a reference to the realm.user
- the user whose credentials are being searched.- Returns:
- a non-null
Stream
of credential types.
-
isConfiguredFor
- Specified by:
isConfiguredFor
in interfaceCredentialInputValidator
-
isValid
Description copied from interface:CredentialInputValidator
Tests whether a credential is valid- Specified by:
isValid
in interfaceCredentialInputValidator
- Parameters:
realm
- The realm in which to which the credential belongs touser
- The user for which to test the credentialinput
- the credential details to verify- Returns:
- true if the passed secret is correct
-
getType
- Specified by:
getType
in interfaceCredentialProvider<PasswordCredentialModel>
-
getCredentialTypeMetadata
public CredentialTypeMetadata getCredentialTypeMetadata(CredentialTypeMetadataContext metadataContext) - Specified by:
getCredentialTypeMetadata
in interfaceCredentialProvider<PasswordCredentialModel>
-