Class DisableTotpUseCase

java.lang.Object
com.irurueta.authserver.authorization.application.totp.DisableTotpUseCase

@Service @Transactional public class DisableTotpUseCase extends Object
Use case that removes the authenticator app of a user together with the recovery codes that went with it. Every trusted device of the user is revoked as well, since a device trusted to skip a second factor must not outlive it, and the removal is audited.
  • Field Details

    • totpCredentialRepository

      private final TotpCredentialRepository totpCredentialRepository
      Port that stores the TOTP credentials.
    • recoveryCodeRepository

      private final RecoveryCodeRepository recoveryCodeRepository
      Port that stores the recovery codes.
    • 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

    • DisableTotpUseCase

      public DisableTotpUseCase()
  • Method Details

    • execute

      public void execute(UUID userId, String username)
      Disables TOTP.
      Parameters:
      userId - identifier of the user.
      username - name of the user, for the audit log.