mooltipass / moolticute

Mooltipass crossplatform daemon/tools
GNU General Public License v3.0
141 stars 66 forks source link

Add TOTP secret from QR code, fix #1044 #1213

Closed deXol closed 1 month ago

deXol commented 4 months ago

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:alice@google.com?secret=JBSWY3DPEHPK3PXP&issuer=Example

Implementation

Currently two ways of TOTP QR read is implemented:

  1. 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.

  2. 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

Note

On Mac there is an issue with processing clipboard dataChanged signal (https://doc.qt.io/qt-6/qclipboard.html#dataChanged). As a workaround I implemented a check in MMM, when Moolticute app is activated in MMM then I am checking the content of the clipboard. An image is only processed once.

limpkin commented 2 months ago

that's a lot of files... could we use submodules instead, in case bug are detected in our dependencies?