Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

provisioning_uri generates wrong URI #88

Closed
josefschabasser opened this issue Nov 13, 2019 · 2 comments
Closed

provisioning_uri generates wrong URI #88

josefschabasser opened this issue Nov 13, 2019 · 2 comments

Comments

@josefschabasser
Copy link

Hi!

provisioning_uri generates a wrong URI, which results in an invalid QR code.
Here's what I did:

import pyotp

totp = pyotp.TOTP('ASFAS75ASDF75889G9AD7S69AS7697AS', digits=8)
totp.provisioning_uri('EU123412341234', issuer_name='Blizzard')

This prints

otpauth://totp/Blizzard:EU123412341234?secret=ASFAS75ASDF75889G9AD7S69AS7697AS&issuer=Blizzard&digits=8

which is missing a : between the name and ?. This generates an invalid QR code.

This would be the correct URI:

otpauth://totp/Blizzard:EU123412341234:?secret=ASFAS75ASDF75889G9AD7S69AS7697AS&issuer=Blizzard&digits=8

which works as intended.

QR codes tested with qrencode and andOTP.
Please see jleclanche/python-bna#24 for a current workaround using sed or awk.

Tested on Arch Linux using python-pyotp 2.3.0.

Best Regards
Josef

@tilkinsc
Copy link

tilkinsc commented Nov 14, 2019

Isn't the URI function actually missing something it needs? Yes it is. The provisioning URI is missing things that need to be put into it. So I'll just assume that its an incomplete function rather than a broken one.

@josefschabasser
Copy link
Author

I found the issue. The resulting URI is correct and working, but python-bna always adds a new line at the end, which is messing up the qr code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants