java.lang.Object
com.irurueta.authserver.authorization.api.web.totp.TotpDtoMapper

@Component public class TotpDtoMapper extends Object
Maps the results of the authenticator app and recovery code use cases onto the DTOs generated from the contract.
  • Constructor Details

    • TotpDtoMapper

      public TotpDtoMapper()
  • Method Details

    • toEnrollmentResponse

      public TotpEnrollmentResponse toEnrollmentResponse(String otpauthUri, String qrCode)
      Maps a pending enrolment.
      Parameters:
      otpauthUri - the otpauth:// URI that carries the secret.
      qrCode - the URI as a QR code, in a data: URI.
      Returns:
      the answer to the enrolment.
    • toRecoveryCodesResponse

      public RecoveryCodesResponse toRecoveryCodesResponse(List<String> codes)
      Maps a freshly generated set of recovery codes; all of them are unused.
      Parameters:
      codes - the codes in clear text.
      Returns:
      the answer, whose remaining is the size of the set.