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
Modifier and TypeMethodDescriptionGet credential owner entity idvoid
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 Details
-
getSettings
String getSettings()- Returns:
- settings of credential reset
-
setSubject
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
Verifies if the dynamic data about the subject is correct. Currently only the email code.- Parameters:
emailCode
-- Throws:
WrongArgumentException
TooManyAttempts
-
sendCode
Sends a random confirmation code to the receiver.- Throws:
EngineException
-
getCredentialConfiguration
String getCredentialConfiguration()- Returns:
- JSON with the current credential configuration of the subject
-
updateCredential
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:
-