TOTPDevice.config_url urlencodes Issuer with quote_plus

10 views
Skip to first unread message

W Koot

unread,
Feb 8, 2019, 5:05:13 AM2/8/19
to django-otp
The TOTPDevice.config_url calls urlencode on params, including issuer. However, this encodes spaces in OTP_TOTP_ISSUER as pluses instead of %20.
The Issuer is expected to be encoded according to RFC 3986, as mentioned in https://github.com/google/google-authenticator/wiki/Key-Uri-Format#issuer.
Within Microsoft Authenticator this plus-encoded issuer is displayed, while in Authy the spaces are displayed as expected. I haven't tried other authenticator apps.

Find attached the original qrcode with spaces encoded as pluses, and an alternate version where spaces are encoded as %20 - which does work in both apps.
Could the urlencoding of params be altered to ensure issuer is quote'd instead of quote_plus'ed ?
issuer_space_p20.png
issuer_space_plus.png

Peter Sagerson

unread,
Feb 8, 2019, 11:11:48 AM2/8/19
to djang...@googlegroups.com
Sounds easy enough. Feel free to send a pull request.

Thanks,
Peter


--
You received this message because you are subscribed to the Google Groups "django-otp" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-otp+...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
<issuer_space_p20.png><issuer_space_plus.png>

W Koot

unread,
Feb 11, 2019, 6:41:05 AM2/11/19
to djang...@googlegroups.com
The bitbucket interface disagreed with me at first, but I believe there's now a PR posted to address the issue.

Peter Sagerson

unread,
Feb 11, 2019, 12:52:33 PM2/11/19
to djang...@googlegroups.com
Thanks. Version 0.5.2.
Reply all
Reply to author
Forward
0 new messages