[WIP] Add TOTP secret from QR code, fix #1044
WIP
Integrated https://github.com/ftylitak/qzxing library for reading QR code. Added wrapper for TOTP reading.
Implementation
TOTP QR format:
otpauth://totp/<service>:<login>?PARAMETERS
Example:
otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example
Implementation
Currently two ways of TOTP QR read is implemented:
-
Create a screenshot of TOTP QR Screenshot is detected when user is in MMM and tries to find the credential provided in TOTP URI and add TOTP for credential, if service or login is not found after user confirmation add service/login and TOTP. In MMM screenshot is detected and creates non-exising credential: Example Process clipboard data after entering MMM: Example Screenshot the TOTP QR image and enter MMM, after entering TOTP is detected from clipboard. In TOTP QR service is gmail, this service is not available in DB, but it has a gmail.com service, so during scan QR Moolticute asks the user if they want to add it for this service.
-
Scan QR for given credential For "Setup TOTP Credential" a QR option is added which will fill the available datas from TOTP QR image: Example
TODOs
- ~Improve UI for TOTP reading For testing I added a Scan QR button for reading TOTP QR and processing it.~
- ~Add solution to paste QR image from clipboard~
- Improve dialog texts during adding TOTP
- TOTP storage for credential with multiple domain fails. (not related to QR read)
- Test with other TOTP examples
- ~Test with older unix build~ (Works on xenial, bionic)~