Giter VIP home page Giter VIP logo

Comments (4)

jasonab avatar jasonab commented on June 18, 2024 3

In case anyone needs it, qrserver.com will work instead:

private static final String qrCodeGeneratorUrl = "https://api.qrserver.com/v1/create-qr-code/?data=%s&size=150x150";

String authUrl = GoogleAuthenticatorQRGenerator.getOtpAuthTotpURL(issuer, username, key);

try {
    return String.format(qrCodeGeneratorUrl, URLEncoder.encode(authUrl, StandardCharsets.UTF_8.name()));
} catch (UnsupportedEncodingException e) {
    throw new RuntimeException("UTF-8 encoding is not supported by URLEncoder", e);
}

from googleauth.

fireandfuel avatar fireandfuel commented on June 18, 2024 1

This can be implemented without using any web API with com.google.zxing:core Version 3.4.0

Example code how to generate the QR code can be found here: CalliCoder - Generate QR Code in java using zxing
The version of zxing is a little bit outdated there, but should still work if you replace the version at the maven dependencies.

from googleauth.

emcrisostomo avatar emcrisostomo commented on June 18, 2024

I've actually arrived to the conclusion that the library should not try to do more than just one thing. I think I'll drop the QR management code ASAP.

from googleauth.

emcrisostomo avatar emcrisostomo commented on June 18, 2024

Fixed in v. 1.3.0, switching to the QR code API.

from googleauth.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.