Package org.keycloak.credential
Class OTPCredentialProvider
java.lang.Object
org.keycloak.credential.OTPCredentialProvider
- All Implemented Interfaces:
CredentialInputValidator
,CredentialProvider<OTPCredentialModel>
,Provider
public class OTPCredentialProvider
extends Object
implements CredentialProvider<OTPCredentialModel>, CredentialInputValidator
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncreateCredential
(RealmModel realm, UserModel user, OTPCredentialModel credentialModel) boolean
deleteCredential
(RealmModel realm, UserModel user, String credentialId) getCredentialTypeMetadata
(CredentialTypeMetadataContext metadataContext) getType()
boolean
isConfiguredFor
(RealmModel realm, UserModel user) boolean
isConfiguredFor
(RealmModel realm, UserModel user, String credentialType) boolean
isValid
(RealmModel realm, UserModel user, CredentialInput credentialInput) Tests whether a credential is validboolean
supportsCredentialType
(String credentialType) 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
-
OTPCredentialProvider
-
-
Method Details
-
createCredential
public CredentialModel createCredential(RealmModel realm, UserModel user, OTPCredentialModel credentialModel) - Specified by:
createCredential
in interfaceCredentialProvider<OTPCredentialModel>
-
deleteCredential
- Specified by:
deleteCredential
in interfaceCredentialProvider<OTPCredentialModel>
-
getCredentialFromModel
- Specified by:
getCredentialFromModel
in interfaceCredentialProvider<OTPCredentialModel>
-
supportsCredentialType
- Specified by:
supportsCredentialType
in interfaceCredentialInputValidator
-
isConfiguredFor
- Specified by:
isConfiguredFor
in interfaceCredentialInputValidator
-
isConfiguredFor
-
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 credentialcredentialInput
- the credential details to verify- Returns:
- true if the passed secret is correct
-
getType
- Specified by:
getType
in interfaceCredentialProvider<OTPCredentialModel>
-
getCredentialTypeMetadata
public CredentialTypeMetadata getCredentialTypeMetadata(CredentialTypeMetadataContext metadataContext) - Specified by:
getCredentialTypeMetadata
in interfaceCredentialProvider<OTPCredentialModel>
-