Class CheckSecondFactorLockoutUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.mfa.CheckSecondFactorLockoutUseCase
Use case that tells whether the second factor of a user is locked after too many failed attempts. It locks the
user's attempt row until the end of the caller's transaction, so the verifications of the same user (each a
transactional use case that starts with this check) run one at a time: none of them can pass the check while
another one is about to count a failure.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClockSource of the current time.private final SecondFactorAttemptRepositoryPort that stores the failed-attempt counters. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
secondFactorAttemptRepository
Port that stores the failed-attempt counters. -
clock
Source of the current time.
-
-
Constructor Details
-
CheckSecondFactorLockoutUseCase
public CheckSecondFactorLockoutUseCase()
-
-
Method Details
-
execute
Checks the lockout of a user.- Parameters:
userId- identifier of the user.- Returns:
trueif the second factor is locked right now.
-