-
-
Notifications
You must be signed in to change notification settings - Fork 341
Open
Description
Issue copied from "Secrets", a KeepassXC-compatible GNOME app using this library for TOTP generation. See more about the original issue here.
Description
This library cannot generate an OTP from a URL containing %3A
in the URL (the result of a user using a colon in the name field)
Example
pyauth fails to generate an OTP from the following string:
otpauth://totp/Text%3A%20More%20Text:Secret?secret=FFFFFFFAAAAAABBBBBBB&issuer=Text%3A%20More%20Text
This is due to the %3A
in the URL.
Steps to repeat
- Create a new Entry
- Title it
Text: More Text
- Enter OTP Secret, eg.
FFFFFFFAAAAAABBBBBBB
- Save
(you getotpauth://totp/Text%3A%20More%20Text:Secret?secret=FFFFFFFAAAAAABBBBBBB&issuer=Text%3A%20More%20Text
as the URL generated by "Secrets") - Close
- Open and find Entry (no OTP gen)
Debug info
OS: Fedora Atomic 40 x86_64 (GNOME 46)
Secrets version: 9.6 (Flathub)
Logs
04-09-24 21:19:37 | ERROR | Could not parse OTP
Traceback (most recent call last):
File "/app/lib/python3.11/site-packages/gsecrets/safe_element.py", line 606, in __init__
self._otp = parse_uri(otp_uri) # type: ignore
^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/pyotp/__init__.py", line 68, in parse_uri
raise ValueError('If issuer is specified in both label and parameters, it should be equal.')
ValueError: If issuer is specified in both label and parameters, it should be equal.
04-09-24 21:19:37 | ERROR | Could not parse OTP
Traceback (most recent call last):
File "/app/lib/python3.11/site-packages/gsecrets/safe_element.py", line 606, in __init__
self._otp = parse_uri(otp_uri) # type: ignore
^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/pyotp/__init__.py", line 68, in parse_uri
raise ValueError('If issuer is specified in both label and parameters, it should be equal.')
ValueError: If issuer is specified in both label and parameters, it should be equal.
04-09-24 21:19:37 | ERROR | Could not parse OTP
Traceback (most recent call last):
File "/app/lib/python3.11/site-packages/gsecrets/safe_element.py", line 606, in __init__
self._otp = parse_uri(otp_uri) # type: ignore
^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/pyotp/__init__.py", line 68, in parse_uri
raise ValueError('If issuer is specified in both label and parameters, it should be equal.')
ValueError: If issuer is specified in both label and parameters, it should be equal.
04-09-24 21:19:37 | ERROR | Could not parse OTP
Traceback (most recent call last):
File "/app/lib/python3.11/site-packages/gsecrets/safe_element.py", line 606, in __init__
self._otp = parse_uri(otp_uri) # type: ignore
^^^^^^^^^^^^^^^^^^
File "/app/lib/python3.11/site-packages/pyotp/__init__.py", line 68, in parse_uri
raise ValueError('If issuer is specified in both label and parameters, it should be equal.')
ValueError: If issuer is specified in both label and parameters, it should be equal.
Metadata
Metadata
Assignees
Labels
No labels