Skip to content

Mobile auth: AndroidX Auth Tab, secure token storage, session restore #22

Closed

Description

@altaywtf

Part of #14 (W3 — mobile v1). The secure transport is implemented in #65 with client registration tracked in #47.

Outcome

A user signs into the mobile flavor with their put.io account through AndroidX Auth Tab, stays signed in across restarts, and can sign out. Auth gates every account-backed mobile slice.

Scope

  • OAuth sign-in through AndroidX Auth Tab with exact redirect putio://auth
  • Require and pin the Auth Tab-capable default browser; never fall back to ordinary Custom Tabs
  • Export no callback Activity or custom-scheme manifest filter
  • Validate the exact callback endpoint and pending state before accepting a bounded token
  • Store the token in app-owned, Keystore-backed encrypted storage; never plaintext SharedPreferences or DataStore
  • Restore and validate the session on launch
  • Distinguish API rejection from transport failure: rejection clears the token, transport failure keeps it and offers retry
  • Sign-out clears secure storage, pending auth state, account state, and SDK token state
  • Show loading, failure, retry, cancellation, and secure-storage-unavailable states from the shared contract

Acceptance criteria

  • Sign in, kill the app, and relaunch into the authenticated Files surface
  • A revoked token returns to sign-in with a clear message
  • Cancellation returns quietly to signed out
  • Malformed, mismatched, duplicate, expired, or unsolicited callbacks store nothing and consume the pending attempt
  • ./gradlew verify and both production-debug assembles pass
  • The full registered OAuth round trip is evidenced on the local harness and attached to the implementation PR

Proof

API 37 Google APIs with Chrome 145.0.7632.218 completed the registered OAuth round trip. Real root Files loaded; force-stop/relaunch restored the encrypted session; nested Files loaded; sign-out returned to the signed-out state. The rejected-token, cancellation, and malformed-callback contracts remain covered by the green automated suite. Post-auth captures are attached to #65; credential and callback surfaces were intentionally not captured.

Implementation: #65. Shared contract: putio-frontend#34.

Activity

  1. altaywtf commented on Aug 8, 2026

    @altaywtf
    MemberAuthor

    Additional blocker: #47 — the mobile OAuth client id must exist (owner: Altay/backend) before this slice can run against real auth.

  2. altaywtf commented on Aug 29, 2026

    @altaywtf
    MemberAuthor

    Reconciliation checkpoint (2026-08-29):

    • PR #60 proposes secure token storage, explicit session states, callback parsing, and a receiver that is disabled by default.
    • PR #62 proposes wiring restore/callback state into the mobile UI.
    • Both PRs are open and unmerged. A real browser sign-in round trip remains blocked by Create the Android mobile OAuth client id (owner: Altay/backend) #47's verified App Link or authorization-code + PKCE decision and backend registration.

    This issue stays open until live auth, restart restoration, revoked-token recovery, sign-out, and harness recording satisfy its acceptance criteria.

  3. changed the title [-]Mobile auth: OAuth via Custom Tabs, secure token storage, session restore[/-] [+]Mobile auth: AndroidX Auth Tab, secure token storage, session restore[/+] on Aug 29, 2026
  4. altaywtf commented on Aug 30, 2026

    @altaywtf
    MemberAuthor
  5. altaywtf commented on Sep 3, 2026

    @altaywtf
    MemberAuthor

    Reconciled after the closeout blocker landed: #60, #62, #65, and #71 are merged; #47 and #68 are closed; every scope and acceptance item above is checked with API 37 OAuth, restore, nested Files, and sign-out proof recorded. Closing as completed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions