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

Cannot decode URI due case-sensitivity #133

Closed
LeightonSmallshire opened this issue Apr 1, 2022 · 1 comment
Closed

Cannot decode URI due case-sensitivity #133

LeightonSmallshire opened this issue Apr 1, 2022 · 1 comment

Comments

@LeightonSmallshire
Copy link

When trying to parse a uri provided by runescape, the 'algorithm' parameter causes this error;

File "/usr/local/lib/python3.8/dist-packages/pyotp/init.py", line 78, in parse_uri
ValueError: Invalid value for algorithm, must be SHA1, SHA256 or SHA512

stepping through the code shows this is a capitalization issue and should be easily fixed.

Example URI:
'otpauth://totp/playerName?secret=yourB64SecretHere&issuer=RuneScape&algorithm=sha1&digits=6&period=30'

@kislyuk
Copy link
Member

kislyuk commented Apr 1, 2022

Hello, thanks for your interest in PyOTP.

The otpauth URI specification requires the algorithm value to be capitalized. Thus this appears to be an issue in the runescape implementation. I am not inclined to change our treatment of these parameters without overwhelming evidence that other OTP implementations relax the spec in this way and do the case-insensitive matching described here.

@kislyuk kislyuk closed this as completed Jan 15, 2024
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