Class RegisterSecondFactorFailureUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.mfa.RegisterSecondFactorFailureUseCase
Use case that counts a failed second-factor attempt and locks the second factor of the user once
authserver.mfa.max-failed-attempts consecutive failures are reached. Both the failure and the lockout are
audited. The counter is stored, never kept in memory.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClockSource of the current time.private final MfaPropertiesMulti-factor settings: consecutive failures that lock the second factor and how long it stays locked.private final RecordSecurityEventUseCaseUse case that records the audit events.private final SecondFactorAttemptRepositoryPort that stores the failed-attempt counters. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRegisters a failed attempt.
-
Field Details
-
secondFactorAttemptRepository
Port that stores the failed-attempt counters. -
recordSecurityEventUseCase
Use case that records the audit events. -
clock
Source of the current time. -
mfaProperties
Multi-factor settings: consecutive failures that lock the second factor and how long it stays locked.
-
-
Constructor Details
-
RegisterSecondFactorFailureUseCase
public RegisterSecondFactorFailureUseCase()
-
-
Method Details
-
execute
Registers a failed attempt.- Parameters:
userId- identifier of the user.username- name of the user, for the audit log.- Returns:
- the state of the counter after the failure.
-