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 java.lang.StringgetCredentialConfiguration()java.lang.LonggetEntityId()Get credential owner entity idjava.lang.StringgetSecurityQuestion()java.lang.StringgetSettings()voidsendCode(java.lang.String messageTemplateId, boolean onlyNumberCode)Sends a random confirmation code to the receiver.voidsetSubject(pl.edu.icm.unity.types.basic.IdentityTaV subject)Sets the subject for which the operations are made.voidupdateCredential(java.lang.String newCredential)Changes the credential to a new one.voidverifyDynamicData(java.lang.String emailCode)Verifies if the dynamic data about the subject is correct.voidverifyStaticData(java.lang.String aswer)Verifies if the static data is about the subject is correct.
-
-
-
Method Detail
-
getSettings
java.lang.String getSettings()
- Returns:
- settings of credential reset
-
setSubject
void setSubject(pl.edu.icm.unity.types.basic.IdentityTaV subject)
Sets the subject for which the operations are made.- Parameters:
subject-
-
getSecurityQuestion
java.lang.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(java.lang.String aswer) throws pl.edu.icm.unity.exceptions.WrongArgumentException, pl.edu.icm.unity.exceptions.IllegalIdentityValueException, pl.edu.icm.unity.exceptions.TooManyAttemptsVerifies if the static data is about the subject is correct. Currently only the security question answer.- Parameters:
aswer-- Throws:
pl.edu.icm.unity.exceptions.WrongArgumentExceptionpl.edu.icm.unity.exceptions.IllegalIdentityValueExceptionpl.edu.icm.unity.exceptions.TooManyAttempts
-
verifyDynamicData
void verifyDynamicData(java.lang.String emailCode) throws pl.edu.icm.unity.exceptions.WrongArgumentException, pl.edu.icm.unity.exceptions.TooManyAttemptsVerifies if the dynamic data about the subject is correct. Currently only the email code.- Parameters:
emailCode-- Throws:
pl.edu.icm.unity.exceptions.WrongArgumentExceptionpl.edu.icm.unity.exceptions.TooManyAttempts
-
sendCode
void sendCode(java.lang.String messageTemplateId, boolean onlyNumberCode) throws pl.edu.icm.unity.exceptions.EngineExceptionSends a random confirmation code to the receiver.- Throws:
pl.edu.icm.unity.exceptions.EngineException
-
getCredentialConfiguration
java.lang.String getCredentialConfiguration()
- Returns:
- JSON with the current credential configuration of the subject
-
updateCredential
void updateCredential(java.lang.String newCredential) throws pl.edu.icm.unity.exceptions.EngineExceptionChanges the credential to a new one.- Parameters:
newCredential- new credential, typically encoded in credential specific way.- Throws:
pl.edu.icm.unity.exceptions.EngineException
-
getEntityId
java.lang.Long getEntityId()
Get credential owner entity id- Returns:
-
-