QR code, 400 error

121 views
Skip to first unread message

Dave Bowles

unread,
Oct 28, 2011, 8:18:19 AM10/28/11
to Google Visualization API
The following HTML attempts to open a page to display a one-time-
password key for use with Google Authentication:

<a href="https://www.google.com/chart?chs=200x200&chld=M|
0&cht=qr&chl=otpauth://totp/
bowl...@industrialwebapps.com&secret=GSW32NEGT2R4A6TU">Test Link</a>

The page opens with a "400 error". Simply highlighting a portion of
the URL then hitting the enter key cause the page to draw correctly
despite no change being made to the address.

asgallant

unread,
Oct 28, 2011, 9:10:11 AM10/28/11
to google-visua...@googlegroups.com
It works for me.

Dave Bowles

unread,
Oct 28, 2011, 9:14:13 AM10/28/11
to google-visua...@googlegroups.com
Drew, thanks for your effort!

It works for me if I paste the address directly into a browser address bar.

If the HTML is contained in a PHP file and the resulting link is clicked on, I get the 400 error.



On Fri, Oct 28, 2011 at 9:10 AM, asgallant <drew_g...@abtassoc.com> wrote:
It works for me.

--
You received this message because you are subscribed to the Google Groups "Google Visualization API" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-visualization-api/-/eusQeLHLuJAJ.
To post to this group, send email to google-visua...@googlegroups.com.
To unsubscribe from this group, send email to google-visualizati...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-visualization-api?hl=en.

Dave Bowles

unread,
Jan 2, 2012, 9:45:28 AM1/2/12
to google-visua...@googlegroups.com
Got a tip via email from someone who read this that solved my problem.  Here is a PHP snippet that works:

        // Get the QR Code png file from google and display it
        $png = file_get_contents($url);
        $fn  = '/pdfs/test.png';
        $fh  = fopen('/var/www'.$fn, 'w');
        fwrite($fh, $png);
        fclose($fh);

        echo 'Google Authenticator Key: <b>'.$otp_key.'</b><br />';
        echo 'QR Code for some <a href="twoFactorAuth.php" target="_blank">Smart Phone apps.</a>: ';
        echo '<img src="'.$fn.'" />';

Reply all
Reply to author
Forward
0 new messages