Package org.keycloak.models.credential
Class OTPCredentialModel
- java.lang.Object
-
- org.keycloak.credential.CredentialModel
-
- org.keycloak.models.credential.OTPCredentialModel
-
- All Implemented Interfaces:
Serializable
public class OTPCredentialModel extends CredentialModel
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringHOTPstatic StringTOTPstatic StringTYPE-
Fields inherited from class org.keycloak.credential.CredentialModel
CLIENT_CERT, KERBEROS, OTP, PASSWORD, PASSWORD_HISTORY, PASSWORD_TOKEN, SECRET
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static OTPCredentialModelcreateFromCredentialModel(CredentialModel credentialModel)static OTPCredentialModelcreateFromPolicy(RealmModel realm, String secretValue)static OTPCredentialModelcreateFromPolicy(RealmModel realm, String secretValue, String userLabel)static OTPCredentialModelcreateHOTP(String secretValue, int digits, int counter, String algorithm)static OTPCredentialModelcreateTOTP(String secretValue, int digits, int period, String algorithm)OTPCredentialDatagetOTPCredentialData()OTPSecretDatagetOTPSecretData()voidupdateCounter(int counter)-
Methods inherited from class org.keycloak.credential.CredentialModel
comparingByStartDateDesc, getAlgorithm, getConfig, getCounter, getCreatedDate, getCredentialData, getDevice, getDigits, getHashIterations, getId, getPeriod, getSalt, getSecretData, getType, getUserLabel, getValue, setAlgorithm, setConfig, setCounter, setCreatedDate, setCredentialData, setDevice, setDigits, setHashIterations, setId, setPeriod, setSalt, setSecretData, setType, setUserLabel, setValue, shallowClone
-
-
-
-
Field Detail
-
TYPE
public static final String TYPE
- See Also:
- Constant Field Values
-
TOTP
public static final String TOTP
- See Also:
- Constant Field Values
-
HOTP
public static final String HOTP
- See Also:
- Constant Field Values
-
-
Method Detail
-
createTOTP
public static OTPCredentialModel createTOTP(String secretValue, int digits, int period, String algorithm)
-
createHOTP
public static OTPCredentialModel createHOTP(String secretValue, int digits, int counter, String algorithm)
-
createFromPolicy
public static OTPCredentialModel createFromPolicy(RealmModel realm, String secretValue)
-
createFromPolicy
public static OTPCredentialModel createFromPolicy(RealmModel realm, String secretValue, String userLabel)
-
createFromCredentialModel
public static OTPCredentialModel createFromCredentialModel(CredentialModel credentialModel)
-
updateCounter
public void updateCounter(int counter)
-
getOTPCredentialData
public OTPCredentialData getOTPCredentialData()
-
getOTPSecretData
public OTPSecretData getOTPSecretData()
-
-