Interface CredentialReset
-
public interface CredentialReset
Implementations 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 String
getCredentialConfiguration()
Long
getEntityId()
Get credential owner entity idString
getSecurityQuestion()
String
getSettings()
void
sendCode(String messageTemplateId, boolean onlyNumberCode)
Sends a random confirmation code to the receiver.void
setSubject(AuthenticationSubject subject)
Sets the subject for which the operations are made.void
updateCredential(String newCredential)
Changes the credential to a new one.void
verifyDynamicData(String emailCode)
Verifies if the dynamic data about the subject is correct.void
verifyStaticData(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:
WrongArgumentException
IllegalIdentityValueException
TooManyAttempts
-
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:
WrongArgumentException
TooManyAttempts
-
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:
-
-