Class IsTotpEnabledUseCase
java.lang.Object
com.irurueta.authserver.authorization.application.totp.IsTotpEnabledUseCase
- All Implemented Interfaces:
SecondFactorEnrolmentQuery
@Service
@Transactional(readOnly=true)
public class IsTotpEnabledUseCase
extends Object
implements SecondFactorEnrolmentQuery
Use case that tells whether a user has a confirmed authenticator app. It is also the TOTP
SecondFactorEnrolmentQuery, so a confirmed authenticator app makes the second factor required.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final TotpCredentialRepositoryPort that stores the TOTP credentials. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTells whether a user has a confirmed authenticator app.booleanhasConfirmed(UUID userId) Tells whether a user has confirmed the TOTP second factor.
-
Field Details
-
totpCredentialRepository
Port that stores the TOTP credentials.
-
-
Constructor Details
-
IsTotpEnabledUseCase
public IsTotpEnabledUseCase()
-
-
Method Details
-
execute
Tells whether a user has a confirmed authenticator app.- Parameters:
userId- identifier of the user.- Returns:
truewhen the user has a credential and it is confirmed;falsefor a pending enrolment.
-
hasConfirmed
Tells whether a user has confirmed the TOTP second factor.- Specified by:
hasConfirmedin interfaceSecondFactorEnrolmentQuery- Parameters:
userId- identifier of the user.- Returns:
- the same as
execute(UUID).
-