Skip to content

M0: accounts and sign-in (Login Flow v2, QR, nc://login, account switcher) - #5

Merged
tobiasKaminsky merged 1 commit into
mainfrom
m0/accounts
Dec 3, 2026
Merged

tobiasKaminsky merged 1 commit into
mainfrom
m0/accounts

Conversation

@tobiasKaminsky

Copy link
Copy Markdown
Member

Second M0 PR (SPEC §4.3, §5.1, STATUS.md M0).

What it does

  • Sign in with Login Flow v2: android-common's login screen (android-common#1143) on top of android-library's operations (android-library#2227), both used through JitPack commits until merged
  • QR code scanning (CameraX + zxing, so it also works in the F-Droid flavor) and nc://login links; their credentials are shown for confirmation ("Log in to host as user?") before anything is sent, with a warning for http://
  • Server checks: must be Nextcloud 33 or later; clear errors for unreachable, not Nextcloud, maintenance, rejected login
  • Several accounts: app-wide Room AccountsDatabase, app passwords encrypted with a per-account AES-GCM Android Keystore key, current account in DataStore, account switcher from android-common in the top bar, "Add account"
  • Removing an account runs AccountCleanup hooks (other modules add theirs later) and deletes its Keystore key
  • No account data in Android backup (dataExtractionRules)
  • Navigation 3 skeleton: account gate → home placeholder (library comes in M1)

Structure: only core/network depends on android-library; features use its wrappers (LoginFlowService, AccountService, NetworkFailure).

Tests

  • Unit/Robolectric: repository (encryption, re-login keeps id, removal), DAO, LoginViewModel (QR confirmation, nothing sent before confirming, errors), result mapping; Roborazzi screenshots (light, dark, 200 % font)
  • Real server: scripts/test-server.sh starts Nextcloud 33 in Docker; ServerIntegrationTest (version check, valid/invalid credentials, Login Flow v2 start + pending poll, unreachable server) passes against 33.0.11
  • Not yet tried on a device: the browser hand-off and the camera; please check with the QA APK

Not in this PR (follow-ups): SSO accounts (needs android#18196), untrusted certificates, feature detection, remote wipe, MDM, settings.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Nb4eMg7ShMcjycNqaRBq3z

- core/model: Account, AccountId, AccountKind
- core/database: app-wide AccountsDatabase (Room, exported schema)
- core/network: the only module that uses android-library; LoginFlowService
  (Login Flow v2 operations from android-library#2227), AccountService
  (status.php version check, user lookup), NetworkFailure mapping
- core/data: AccountRepository with Keystore-encrypted app passwords
  (AES-GCM, one key per account), current account in DataStore,
  AccountCleanup hooks for removal, SignInService (Nextcloud 33+ check)
- feature/login: android-common Login Flow v2 screen (android-common#1143),
  QR code scanner (CameraX + zxing, also for F-Droid), nc://login links,
  confirmation before using credentials from QR codes or links, http warning
- app: Navigation 3, account gate, account switcher (android-common chooser),
  nc://login intent filter, backup exclusion of all account data
- scripts/test-server.sh (Docker Nextcloud 33) and ServerIntegrationTest

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Nb4eMg7ShMcjycNqaRBq3z
Signed-off-by: Tobias Kaminsky <tobias@nextcloud.com>
@github-actions

github-actions Bot commented Dec 3, 2026

Copy link
Copy Markdown

📱 QA build

Download app-qa-debug.apk
QR code Open the QR code for this download
Commit 7417bd5
Version 5
Available until 7 days after this build

The QA build installs alongside a released Nextcloud app, so you can keep
using your existing install while testing.

Downloading the file requires a GitHub account, so open this link on the
device you want to test on, or transfer the APK to it.

@tobiasKaminsky
tobiasKaminsky merged commit a3b3b8f into main Dec 3, 2026
6 checks passed
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.

1 participant