java.lang.Object
com.irurueta.authserver.authorization.application.passkeys.DeletePasskeyUseCase

@Service @Transactional public class DeletePasskeyUseCase extends Object
Use case that deletes a passkey of a user and audits the removal. When that leaves the user without any confirmed second factor, every trusted device of the user is revoked too, as disabling TOTP does: a remembered browser stands in for a second factor the user no longer has.
  • Field Details

    • passkeyRepository

      private final PasskeyRepository passkeyRepository
      Port that stores the passkeys.
    • hasConfirmedSecondFactorUseCase

      private final HasConfirmedSecondFactorUseCase hasConfirmedSecondFactorUseCase
      Use case telling whether the user still has a confirmed second factor.
    • trustedDeviceRepository

      private final TrustedDeviceRepository trustedDeviceRepository
      Port that stores the trusted devices.
    • recordSecurityEventUseCase

      private final RecordSecurityEventUseCase recordSecurityEventUseCase
      Use case that records the audit events.
  • Constructor Details

    • DeletePasskeyUseCase

      public DeletePasskeyUseCase()
  • Method Details

    • execute

      public void execute(UUID userId, String username, String id)
      Deletes a passkey; a passkey of another account is never touched.
      Parameters:
      userId - identifier of the signed-in user, for the audit log.
      username - name of the signed-in account.
      id - credential identifier.
      Throws:
      PasskeyNotFoundException - if the account has no passkey with that identifier.