Interface CredentialReset
-
public interface CredentialResetImplementations provide a credential reset functionality. Typically are bound to a particular credential type. Additionally implementation instances must be stateful and maintain an identity for which the reset is performed.- Author:
- K. Benedyczak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StringgetCredentialConfiguration()LonggetEntityId()Get credential owner entity idStringgetSecurityQuestion()StringgetSettings()voidsendCode(String messageTemplateId, boolean onlyNumberCode)Sends a random confirmation code to the receiver.voidsetSubject(AuthenticationSubject subject)Sets the subject for which the operations are made.voidupdateCredential(String newCredential)Changes the credential to a new one.voidverifyDynamicData(String emailCode)Verifies if the dynamic data about the subject is correct.voidverifyStaticData(String aswer)Verifies if the static data is about the subject is correct.
-
-
-
Method Detail
-
getSettings
String getSettings()
- Returns:
- settings of credential reset
-
setSubject
void setSubject(AuthenticationSubject subject)
Sets the subject for which the operations are made.
-
getSecurityQuestion
String getSecurityQuestion()
- Returns:
- the question for the subject, which must be set before. If the question is not defined, a random question is returned, from the configured ones.
-
verifyStaticData
void verifyStaticData(String aswer) throws WrongArgumentException, IllegalIdentityValueException, TooManyAttempts
Verifies if the static data is about the subject is correct. Currently only the security question answer.- Parameters:
aswer-- Throws:
WrongArgumentExceptionIllegalIdentityValueExceptionTooManyAttempts
-
verifyDynamicData
void verifyDynamicData(String emailCode) throws WrongArgumentException, TooManyAttempts
Verifies if the dynamic data about the subject is correct. Currently only the email code.- Parameters:
emailCode-- Throws:
WrongArgumentExceptionTooManyAttempts
-
sendCode
void sendCode(String messageTemplateId, boolean onlyNumberCode) throws EngineException
Sends a random confirmation code to the receiver.- Throws:
EngineException
-
getCredentialConfiguration
String getCredentialConfiguration()
- Returns:
- JSON with the current credential configuration of the subject
-
updateCredential
void updateCredential(String newCredential) throws EngineException
Changes the credential to a new one.- Parameters:
newCredential- new credential, typically encoded in credential specific way.- Throws:
EngineException
-
getEntityId
Long getEntityId()
Get credential owner entity id- Returns:
-
-