Package org.keycloak.models
Class UserCredentialModel
- java.lang.Object
-
- org.keycloak.models.UserCredentialModel
-
- All Implemented Interfaces:
CredentialInput
- Direct Known Subclasses:
PasswordUserCredentialModel
public class UserCredentialModel extends Object implements CredentialInput
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
-
Field Summary
Fields Modifier and Type Field Description static String
CLIENT_CERT
static String
HOTP
Deprecated.static String
KERBEROS
protected Map<String,Object>
notes
static String
PASSWORD
Deprecated.static String
PASSWORD_HISTORY
Deprecated.static String
PASSWORD_TOKEN
Deprecated.static String
SECRET
static String
TOTP
Deprecated.
-
Constructor Summary
Constructors Constructor Description UserCredentialModel()
UserCredentialModel(String credentialId, String type, String challengeResponse)
UserCredentialModel(String credentialId, String type, String challengeResponse, boolean adminRequest)
-
Method Summary
-
-
-
Field Detail
-
PASSWORD
@Deprecated public static final String PASSWORD
Deprecated.- See Also:
- Constant Field Values
-
PASSWORD_HISTORY
@Deprecated public static final String PASSWORD_HISTORY
Deprecated.- See Also:
- Constant Field Values
-
TOTP
@Deprecated public static final String TOTP
Deprecated.- See Also:
- Constant Field Values
-
HOTP
@Deprecated public static final String HOTP
Deprecated.- See Also:
- Constant Field Values
-
PASSWORD_TOKEN
@Deprecated public static final String PASSWORD_TOKEN
Deprecated.- See Also:
- Constant Field Values
-
SECRET
public static final String SECRET
- See Also:
- Constant Field Values
-
KERBEROS
public static final String KERBEROS
- See Also:
- Constant Field Values
-
CLIENT_CERT
public static final String CLIENT_CERT
- See Also:
- Constant Field Values
-
-
Method Detail
-
password
public static PasswordUserCredentialModel password(String password)
-
password
public static PasswordUserCredentialModel password(String password, boolean adminRequest)
-
passwordToken
@Deprecated public static UserCredentialModel passwordToken(String passwordToken)
Deprecated.
-
otp
public static UserCredentialModel otp(String type, String key)
- Parameters:
type
- must be "totp" or "hotp"key
-- Returns:
-
totp
public static UserCredentialModel totp(String key)
-
hotp
public static UserCredentialModel hotp(String key)
-
secret
public static UserCredentialModel secret(String password)
-
kerberos
public static UserCredentialModel kerberos(String token)
-
generateSecret
public static UserCredentialModel generateSecret()
-
buildFromBackupAuthnCode
public static UserCredentialModel buildFromBackupAuthnCode(String backupAuthnCodeInput)
-
buildFromBackupAuthnCode
public static UserCredentialModel buildFromBackupAuthnCode(String credentialId, String backupAuthnCodeInput)
-
getCredentialId
public String getCredentialId()
- Specified by:
getCredentialId
in interfaceCredentialInput
-
getType
public String getType()
- Specified by:
getType
in interfaceCredentialInput
-
setType
public void setType(String type)
-
getChallengeResponse
public String getChallengeResponse()
- Specified by:
getChallengeResponse
in interfaceCredentialInput
-
isAdminRequest
public boolean isAdminRequest()
-
isOtp
@Deprecated public static boolean isOtp(String type)
Deprecated.This method exists only because of the backwards compatibility
-
getValue
public String getValue()
This method exists only because of the backwards compatibility. It is recommended to usegetChallengeResponse()
instead
-
setValue
public void setValue(String value)
-
getDevice
public String getDevice()
-
setDevice
public void setDevice(String device)
-
getAlgorithm
public String getAlgorithm()
-
setAlgorithm
public void setAlgorithm(String algorithm)
-
removeNote
public void removeNote(String key)
-
-