Closed josefschabasser closed 5 years ago
Workaround:
bna show-url | awk -v ORS= '{gsub(/\?/,":?");}1' | qrencode -t UTF8
or
bna show-url | sed -r 's/[?]+/:?/g' | tr -d "\n" | qrencode -t UTF8
I use the PyOTP library to generate that URL, could you report the issue there?
I fixed the readme.
I found the real issue. I couldn't reproduce it with pyotp on my own, but I found something different. The provisioning URI is working and correct, but python-bna is always adding a new line at the end. This is messing up the resulting QR code.
python-bna:
$ bna show-url | qrencode -t PNG -o otpauth.png
$ zbarimg --xml otpauth.png
<barcodes xmlns='http://zbar.sourceforge.net/2008/barcode'>
<source href='otpauth.png'>
<index num='0'>
<symbol type='QR-Code' quality='1'><data><![CDATA[otpauth://totp/Blizzard:EU123412341234?secret=ASFAS75ASDF75889G9AD7S69AS7697AS&issuer=Blizzard&digits=8
]]></data></symbol>
</index>
</source>
</barcodes>
scanned 1 barcode symbols from 1 images
python-bna with newline trimmed:
$ bna show-url | tr -d "\n" | qrencode -t PNG -o otpauth.png
$ zbarimg --xml otpauth.png
<barcodes xmlns='http://zbar.sourceforge.net/2008/barcode'>
<source href='otpauth.png'>
<index num='0'>
<symbol type='QR-Code' quality='1'><data><![CDATA[otpauth://totp/Blizzard:EU123412341234?secret=ASFAS75ASDF75889G9AD7S69AS7697AS&issuer=Blizzard&digits=8]]></data></symbol>
</index>
</source>
</barcodes>
scanned 1 barcode symbols from 1 images
Fixed thanks!
I'm glad I could help! Thanks for fixing it!
Hello!
If I run
bna show-url
then the URL is missing:
between the serial number and the?
:This URL results in an invalid QR code if generated via qrencode. The URL in the readme is correct, though.
Best Regards Josef
PS: the readme is incorrect about the QR code genration. The readme still shows
bna --otpauth-url
which should be changed tobna show-url
.