nextcloud / twofactor_totp

🔑 Second factor TOTP (RFC 6238) provider for Nextcloud
https://apps.nextcloud.com/apps/twofactor_totp
GNU Affero General Public License v3.0
286 stars 58 forks source link

Provide Favicon as Image #1407

Open jotoeri opened 1 year ago

jotoeri commented 1 year ago

Feature Request

Currently the provided QR-Code does not contain any image, resulting in apps just using any default image. Nice gimmick would be, if the QR-Code provided the Image-URL to the Clouds Favicon (&image=URL within QR-Code), so the otp app has some customized appearance.

ernolf commented 1 month ago

Nice gimmick would be, if the QR-Code provided the Image-URL to the Clouds Favicon (&image=URL within QR-Code), so the otp app has some customized appearance.

The transfer of an image as an URL parameter is not included in the Key-Uri-Format specification. If you add an image URL of an svg element in the URL, then depending on the QR library used, the image can be processed in the QR code, as can be seen and tried out in this example QR code generator. I am not aware of any TOTP app though, that takes over an icon in this way. If you know of an app that does this, please let me know. I can, however, highly recommend the Aegis app to Android users. For each account, you can either take an icon from the community icon project or insert your own icon.

ernolf

jotoeri commented 1 month ago

FreeOTP does it e.g. https://github.com/freeotp/freeotp-android/blob/master/URI.md#image

ernolf commented 1 month ago

Hi @jotoeri,

FreeOTP does it

Did you get it to work with any icon?

The example QR Code Generator I linked to, is from FreeOTP and shows the Icon inside of the QR Code but I was unable to get any image visible inside of the FreeOTP App. I have tried it with many different Icons, from FontAwsome as well. I would like to understand why. If I know exactly if the Icon e.g. needs some treatment, I would try to implement this feature in the code, to make FreeOTP not look that sad. :wink: Unfortunately one cannot assign any icon in FreeOTP or change any other major setting. One can only edit the Isuer and the account name. Changing other values is not possible unless you have saved the secret somewhere else so that you can use the QR code generator to make subsequent changes to Digit (OTP token length) and HashAlgorithm. Or you enter everything by hand, which is possible too but then a subsequent editing is still not possible. Compared to the range of functions, the setting options and the appearance of Aegis, FreeOTP is really pathetic!

jotoeri commented 1 month ago

Hmm, just seems like it needs to be a png or something similar. As i have a png as favicon on my cloud, it works. SVG also didnt work for me.

ernolf commented 1 month ago

seems like it needs to be a png

Yes. I got it working!