Class IsUserMfaRequiredUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.mfa.IsUserMfaRequiredUseCase
Use case that tells whether the account of a user requires a second factor, whatever the client being served: when
an administrator forced it (
users.mfa_required) or when the user has confirmed a second factor (asked to
HasConfirmedSecondFactorUseCase), since a factor the user enrolled must protect every sign-in. The two
stay separate: removing the last second factor lifts the second, never the first.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final HasConfirmedSecondFactorUseCaseUse case that tells whether the user has confirmed a second factor.private final UserAccountRepositoryPort that provides the user accounts.private final UserMfaSettingsRepositoryPort that stores the per-user multi-factor settings. -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
userAccountRepository
Port that provides the user accounts. -
userMfaSettingsRepository
Port that stores the per-user multi-factor settings. -
hasConfirmedSecondFactorUseCase
Use case that tells whether the user has confirmed a second factor.
-
-
Constructor Details
-
IsUserMfaRequiredUseCase
public IsUserMfaRequiredUseCase()
-
-
Method Details
-
execute
Tells whether an account requires a second factor.- Parameters:
username- name the user signs in with.- Returns:
truewhen the account exists and either an administrator requires it or the user has a confirmed second factor;falseotherwise, or when the account does not exist.
-