[GH-ISSUE #199] QRCode URL shows 404 #324

Closed
opened 2026-03-01 17:49:11 +03:00 by kerem · 8 comments
Owner

Originally created by @mm-louis on GitHub (Apr 10, 2024).
Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/199

For some reason, URL is not working.
Here's the sample. https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth%3A%2F%2Ftotp%2FKirlin%2520and%2520Sons%3Ajarod12%2540yahoo.com%3Fsecret%3DJBYGUTKKJA4XKWDEMRHTOQTZLBKGC4CNZCMKL7OLPPOV3FEQEUSYW4EQ7OSRPLHD%26issuer%3DKirlin%2520and%2520Sons

Also, I tried demo page, the QR code image can not be shown either.

Originally created by @mm-louis on GitHub (Apr 10, 2024). Original GitHub issue: https://github.com/antonioribeiro/google2fa/issues/199 For some reason, URL is not working. Here's the sample. https://chart.googleapis.com/chart?chs=200x200&chld=M|0&cht=qr&chl=otpauth%3A%2F%2Ftotp%2FKirlin%2520and%2520Sons%3Ajarod12%2540yahoo.com%3Fsecret%3DJBYGUTKKJA4XKWDEMRHTOQTZLBKGC4CNZCMKL7OLPPOV3FEQEUSYW4EQ7OSRPLHD%26issuer%3DKirlin%2520and%2520Sons Also, I tried demo page, the QR code image can not be shown either.
kerem closed this issue 2026-03-01 17:49:11 +03:00
Author
Owner

@akyagmur commented on GitHub (Apr 15, 2024):

Unfortunately, this service has been deprecated.

<!-- gh-comment-id:2056616057 --> @akyagmur commented on GitHub (Apr 15, 2024): Unfortunately, this service has been deprecated.
Author
Owner

@dragonofmercy commented on GitHub (Apr 16, 2024):

You can switch to this library and use his local QR Code generator

https://github.com/RobThree/TwoFactorAuth

<!-- gh-comment-id:2058295049 --> @dragonofmercy commented on GitHub (Apr 16, 2024): You can switch to this library and use his local QR Code generator https://github.com/RobThree/TwoFactorAuth
Author
Owner

@ankit-singh-vu commented on GitHub (Apr 16, 2024):

I am facing the same issue from almost 2 weeks. What is good alternative ? Bacon/QRCode?

<!-- gh-comment-id:2058297772 --> @ankit-singh-vu commented on GitHub (Apr 16, 2024): I am facing the same issue from almost 2 weeks. What is good alternative ? Bacon/QRCode?
Author
Owner

@dragonofmercy commented on GitHub (Apr 16, 2024):

I use like this

use RobThree\Auth\TwoFactorAuth;
use RobThree\Auth\Providers\Qr\BaconQrCodeProvider;

$driver = new BaconQrCodeProvider(0, '#ffffff', '#000000', 'svg');
$tfa = new TwoFactorAuth('Company name', 6, 30, 'sha1', $driver);

$tfa->getQRCodeImageAsDataUri('accountname', 'secret', 200);

for the secret use

$secret = $tfa->createSecret();

Don't forget

composer require robthree/twofactorauth
composer require bacon/bacon-qr-code

<!-- gh-comment-id:2058361250 --> @dragonofmercy commented on GitHub (Apr 16, 2024): I use like this ```php use RobThree\Auth\TwoFactorAuth; use RobThree\Auth\Providers\Qr\BaconQrCodeProvider; $driver = new BaconQrCodeProvider(0, '#ffffff', '#000000', 'svg'); $tfa = new TwoFactorAuth('Company name', 6, 30, 'sha1', $driver); $tfa->getQRCodeImageAsDataUri('accountname', 'secret', 200); ```` for the secret use ```php $secret = $tfa->createSecret(); ```` Don't forget composer require robthree/twofactorauth composer require bacon/bacon-qr-code
Author
Owner

@mfn commented on GitHub (Apr 16, 2024):

https://github.com/Bacon/BaconQrCode , it's supported (I use it with google2fa-laravel) and has a SVG backend -> basically no external dependencies and majority of browsers support it.

<!-- gh-comment-id:2058365342 --> @mfn commented on GitHub (Apr 16, 2024): https://github.com/Bacon/BaconQrCode , it's supported (I use it with google2fa-laravel) and has a SVG backend -> basically no external dependencies and majority of browsers support it.
Author
Owner

@ankit-singh-vu commented on GitHub (Apr 16, 2024):

instead of getQRCodeGoogleUrl() , i used getQRCodeInline() and it worked fine.
It required pragmarx/google2fa, pragmarx/google2fa-qrcode and bacon/bacon-qr-code packages.

<?php
use PragmaRX\Google2FAQRCode\Google2FA as Google2FAQRCodeGoogle2FA;

        $google2fa = new Google2FAQRCodeGoogle2FA();
    
        $inlineUrl = $google2fa->getQRCodeInline(
            $companyName,
            $companyEmail,
            $secretKey
        );
        
        echo $inlineUrl ; //svg format
?>
<!-- gh-comment-id:2058775177 --> @ankit-singh-vu commented on GitHub (Apr 16, 2024): instead of getQRCodeGoogleUrl() , i used getQRCodeInline() and it worked fine. It required pragmarx/google2fa, pragmarx/google2fa-qrcode and bacon/bacon-qr-code packages. ``` <?php use PragmaRX\Google2FAQRCode\Google2FA as Google2FAQRCodeGoogle2FA; $google2fa = new Google2FAQRCodeGoogle2FA(); $inlineUrl = $google2fa->getQRCodeInline( $companyName, $companyEmail, $secretKey ); echo $inlineUrl ; //svg format ?> ```
Author
Owner

@antonioribeiro commented on GitHub (Apr 16, 2024):

Yeah the Google service was scheduled to go down. It's actually better to have it inline anyways, like @ankit-singh-vu is doing. Both chillerlan/php-qrcode and Bacon works fine.

<!-- gh-comment-id:2058992785 --> @antonioribeiro commented on GitHub (Apr 16, 2024): Yeah the Google service was scheduled to go down. It's actually better to have it inline anyways, like @ankit-singh-vu is doing. Both chillerlan/php-qrcode and Bacon works fine.
Author
Owner

@mm-louis commented on GitHub (Apr 16, 2024):

Thanks everyone! I opted for image-charts.com instead of the Google one.

<!-- gh-comment-id:2059744709 --> @mm-louis commented on GitHub (Apr 16, 2024): Thanks everyone! I opted for image-charts.com instead of the Google one.
Sign in to join this conversation.
No labels
bug
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/google2fa#324
No description provided.