Skip to content

Add Google Authenticator 2FA import#4

Open
immz4 wants to merge 4 commits intoFoundation-Devices:mainfrom
immz4:2fa-import-google-auth
Open

Add Google Authenticator 2FA import#4
immz4 wants to merge 4 commits intoFoundation-Devices:mainfrom
immz4:2fa-import-google-auth

Conversation

@immz4
Copy link
Copy Markdown
Contributor

@immz4 immz4 commented Apr 2, 2026

Description

This PR adds check to 2FA QR code scan for Google Authenticator export QR codes. It also includes logic for importing multiple 2FA accounts, which can be later used with other import types.

Test suite

Every Google Authenticator QR code contains up to 10 accounts. If export size is larger than 10, multiple QR codes are generated (which can be sequentially scanned).

image

This QR contains 4 test accounts, one of them is a duplicate, so only three will be imported.

Tests results

device_screenshot_1 device_screenshot_2

immz4 added 2 commits April 2, 2026 21:52
Add check to 2FA QR code scan for Google Auth export QR codes.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds support for importing Google Authenticator “migration” (export) QR codes by parsing the migration URI into multiple TOTP entries and providing a UI confirmation flow before bulk-importing them.

Changes:

  • Detect and parse otpauth-migration://offline?... QR codes into multiple TOTP accounts (protobuf + base64 decode).
  • Add “import multiple accounts” confirmation modal and callback plumbing to proceed/cancel.
  • Add batch-import logic with label de-duplication/prefixing and supporting dependencies (prost/regex/base32/etc).

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 12 comments.

Show a summary per file
File Description
Cargo.lock Adds/updates transitive deps to support migration parsing (prost/regex/url/etc).
apps/gui-app-authenticator/Cargo.toml Adds new dependencies needed for migration parsing and import.
apps/gui-app-authenticator/ui/pages/main/page.slint Shows a confirmation modal when a multi-account import is pending.
apps/gui-app-authenticator/ui/authenticator-callbacks.slint Adds callbacks/properties for multi-import flow.
apps/gui-app-authenticator/src/main.rs Detects migration QR codes, stores pending imports, and implements batch import/cancel callbacks.
apps/gui-app-authenticator/src/lib.rs Exposes migration module and shared helpers (timestamp + import label generation).
apps/gui-app-authenticator/src/google_migration.rs Implements migration URI parsing/decoding and converts payload entries to otpauth URLs.
apps/gui-app-authenticator/proto/google_auth_migration.proto Defines protobuf schema for Google Auth migration payload.
apps/gui-app-authenticator/proto/google_auth_migration.rs Generated protobuf Rust types used by prost decode.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants