If the current site is hosted on a non-standard port, e.g. 8000 is used by Django's runserver command, get_otpauth_url will generate a URL that has multiple : in the label section which in turn causes FreeOTP to reject the token as invalid
Expected Behavior
The token is valid, FreeOTP accepts the URL/secret key via QR code and setup can be completed
Current Behavior
FreeOTP throws an error
Possible Solution
According to this document:
Neither issuer nor account name may themselves contain a colon
get_otpauth_url should either strip or replace additional colons
Steps to Reproduce (for bugs)
- Start
python manage.py runserver
- Start 2FA setup
- Scan the QR code with FreeOTP
Context
While investigating #767 I ran into this bug and it made going through setup multiple times more of a chore than was necessary.
Your Environment
If the current site is hosted on a non-standard port, e.g. 8000 is used by Django's
runservercommand,get_otpauth_urlwill generate a URL that has multiple:in the label section which in turn causes FreeOTP to reject the token as invalidExpected Behavior
The token is valid, FreeOTP accepts the URL/secret key via QR code and setup can be completed
Current Behavior
FreeOTP throws an error
Possible Solution
According to this document:
get_otpauth_urlshould either strip or replace additional colonsSteps to Reproduce (for bugs)
python manage.py runserverContext
While investigating #767 I ran into this bug and it made going through setup multiple times more of a chore than was necessary.
Your Environment