Class ConfirmTotpAtSignInUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.totp.ConfirmTotpAtSignInUseCase
Use case that confirms the enrolment of an authenticator app inside the sign-in, where the code also stands as the
second factor of that sign-in: like
VerifyTotpUseCase, a locked second factor is refused, a wrong code
counts towards the lockout and a right one clears the counter and is audited.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final CheckSecondFactorLockoutUseCaseUse case that tells whether the second factor is locked (and serializes the attempts of a user).private final ConfirmTotpUseCaseUse case that confirms the enrolment.private final RecordSecurityEventUseCaseUse case that records the audit events.private final RegisterSecondFactorFailureUseCaseUse case that counts a failure.private final ResetSecondFactorFailuresUseCaseUse case that clears the failures. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
confirmTotpUseCase
Use case that confirms the enrolment. -
checkSecondFactorLockoutUseCase
Use case that tells whether the second factor is locked (and serializes the attempts of a user). -
registerSecondFactorFailureUseCase
Use case that counts a failure. -
resetSecondFactorFailuresUseCase
Use case that clears the failures. -
recordSecurityEventUseCase
Use case that records the audit events.
-
-
Constructor Details
-
ConfirmTotpAtSignInUseCase
public ConfirmTotpAtSignInUseCase()
-
-
Method Details
-
execute
Confirms the enrolment with the first code of the authenticator app.- Parameters:
userId- identifier of the user.username- name of the user, for the audit log.code- the code as typed.- Returns:
- the clear-text recovery codes, to be shown once; empty when the code is wrong (the failure is counted).
- Throws:
SecondFactorLockedException- if the second factor of the user is locked.TotpNotEnrolledException- if no enrolment was started.TotpAlreadyEnabledException- if the enrolment was already confirmed.
-