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

@Component public class QrCodeRenderer extends Object
Renders a text as a QR code, as a PNG image in a data: URI an authenticator app enrolment page can show without another request. The image is built in memory and never stored or logged, since it carries a secret.
  • Field Details

  • Constructor Details

    • QrCodeRenderer

      public QrCodeRenderer()
  • Method Details

    • render

      public String render(String content)
      Renders a text.
      Parameters:
      content - the text to encode.
      Returns:
      a data:image/png;base64,... URI of the QR code.
      Throws:
      IllegalStateException - if the text cannot be encoded.