wmlele / devise-otp

Two Factors authentication for Devise using Time Based OTP/rfc6238 tokens.
MIT License
204 stars 39 forks source link

Google QR Code Generator API no longer available #90

Closed pkarjala closed 1 week ago

pkarjala commented 3 weeks ago

Instructions at https://github.com/wmlele/devise-otp/blob/master/docs/QR_CODES.md state you may use Google's API to generate a QR code. However, this API was deprecated some time ago as per https://groups.google.com/g/google-visualization-api/c/77YEadph9JY?pli=1

Recommend removing this method and/or replacing it with an alternative, and updating the documentation accordingly

tarellel commented 3 weeks ago

rotp is a dependency gem, that allows you to generate QRcodes. And personally I want to keep the QRcode in app and not rely on a 3rd party for a security measure. So I created a helper I use for generated the OTP QRCode.

  def otp_rqr_image(otp_url)
    return '' if otp_url.blank?

    qr_code = RQRCode::QRCode.new(otp_url)
                             .as_png(resize_exactly_to: 300)
                             .to_data_url
    image_tag(qr_code)
  end
pkarjala commented 3 weeks ago

Thanks will check that out as well.

pkarjala commented 2 weeks ago

As a note, rotp itself does not actually allow you to generate QR codes. It will generate the URI for it, but it does not generate codes itself.

Installing the https://github.com/whomwah/rqrcode gem allows the provided example to function correctly.

strzibny commented 1 week ago

The docs need to be adjusted. I am for just removing this option?

pkarjala commented 1 week ago

I think removing it from the documentation and any code references would be a good solution.

strzibny commented 1 week ago

Yes, no need for 'alternatives' really, let's just have one good working solution.