Class HasConfirmedPasskeyUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.passkeys.HasConfirmedPasskeyUseCase
All Implemented Interfaces:
SecondFactorEnrolmentQuery

@Service @Transactional(readOnly=true) public class HasConfirmedPasskeyUseCase extends Object implements SecondFactorEnrolmentQuery
Use case that tells whether a user has registered a passkey. It is also the passkey SecondFactorEnrolmentQuery: a passkey is registered only by a signed-in user and verified by the browser before it is stored, so a registered passkey is always confirmed, and it makes the second factor required.
  • Field Details

    • passkeyRepository

      private final PasskeyRepository passkeyRepository
      Port that reads the passkeys.
  • Constructor Details

    • HasConfirmedPasskeyUseCase

      public HasConfirmedPasskeyUseCase()
  • Method Details

    • execute

      public boolean execute(UUID userId)
      Tells whether a user has at least one passkey.
      Parameters:
      userId - identifier of the user.
      Returns:
      true when the user has registered a passkey.
    • hasConfirmed

      public boolean hasConfirmed(UUID userId)
      Tells whether a user has confirmed the passkey second factor.
      Specified by:
      hasConfirmed in interface SecondFactorEnrolmentQuery
      Parameters:
      userId - identifier of the user.
      Returns:
      the same as execute(UUID).