Skip to content

Create the Android mobile OAuth client id (owner: Altay/backend) #47

Closed

Description

@altaywtf

Part of #14 (W0 — access and credentials). Owner: Altay/backend.

Outcome

Android mobile has a dedicated OAuth client registration and can prove a full browser sign-in without exposing its bearer callback through Android intent resolution.

TV client IDs 6221 and 6233 are not valid mobile fallbacks. The iOS client ID is not an Android fallback.

Secure transport decision

Use AndroidX Browser Auth Tab with exact redirect putio://auth.

Auth Tab returns the callback URI directly to the Activity that launched it. Android declares no callback intent filter or exported receiver, so another installed app cannot claim the bearer callback through implicit-intent resolution.

The Android implementation must:

  • resolve the default Custom Tabs provider
  • require that exact provider to advertise Auth Tab support
  • pin the launch intent to the verified package
  • fail closed when Auth Tab is unavailable
  • never fall back to an ordinary Custom Tab
  • validate the exact callback endpoint and pending state before accepting a bounded token

Production, nightly, and debug may share putio://auth: no installed package claims the URI, and Auth Tab returns it to the initiating Activity.

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

Do not substitute the backend's current authorization-code exchange as Proof Key for Code Exchange (PKCE). It requires client_secret and accepts no verifier.

Remaining scope

  • Create a dedicated Android mobile OAuth client registration
  • Register exact redirect URI putio://auth
  • Record the numeric mobile client ID in the shared auth contract
  • Add the client ID through the existing BuildConfig input without committing credentials or tokens
  • Prove a complete browser sign-in on the mobile harness with the registered client
  • Attach the full-round-trip evidence to #65

Acceptance criteria

  • No callback receiver or custom-scheme intent filter is exported
  • OAuth launches only through a pinned Auth Tab-capable default browser
  • Builds without the dedicated client ID remain fail closed
  • No mobile variant uses TV IDs 6221/6233 or the iOS client ID
  • Sign-in returns only to the initiating Activity while both installable mobile identities coexist: production/debug io.put.putio.mobile.debug and nightly io.put.putio.mobile.nightly.debug. The generic mobileDebug APK aliases the production/debug application ID, so it cannot be a third installed package
  • #22 completes a real sign-in, process restart, session restore, and sign-out

Live proof

API 37 Google APIs with Chrome 145.0.7632.218 advertised Auth Tab support. Client 9677 completed consent, returned to the initiating Activity, loaded real Files, restored after force-stop/relaunch, opened a nested folder, and signed out. Coexistence proof: both application IDs were installed, Android reported zero putio://auth handlers, production received the Auth Tab result, nightly remained signed out with separate storage, and production restored Files. Post-auth evidence is attached to #65; no credential or bearer-token surface was captured.

Activity

  1. altaywtf commented on Aug 29, 2026

    @altaywtf
    MemberAuthor

    Reconciliation update (2026-08-29):

    • PR #60 proposes the mobile auth foundation, but keeps the callback receiver fail-closed by default.
    • Codex review confirmed that an implicit bearer token returned to an unverified custom scheme can be intercepted by another installed app; state validation does not protect the stolen token.
    • This issue remains unresolved. Before any receiver or live sign-in is enabled, I still need a verified HTTPS App Link or a backend-supported authorization-code flow with PKCE, plus explicit registration and ownership for every supported variant.

    PR #60 does not satisfy or weaken that stop condition.

  2. altaywtf commented on Aug 29, 2026

    @altaywtf
    MemberAuthor

    Client registration is now wired and documented.

    • Public registry verification: client 9677, name put.io Android, callback exactly putio://auth.
    • Android: 4dbfea4 wires the public client ID and tests both mobile variants.
    • Shared contract: d07edcc records the ID in putio-frontend#34.
    • Local proof: the 177-task gate, both production-debug APKs, and mobile launch proof pass. Codex High slopguard reports 0 findings.
    • Harness limit: the reusable API 36 image ships Chrome 133, which does not advertise Auth Tab support. The app fails closed as designed, so I have not claimed or checked off the full browser round trip.

    I am leaving this issue open for the successful Auth Tab sign-in, restart/restore, sign-out, and attached evidence.

  3. altaywtf commented on Aug 30, 2026

    @altaywtf
    MemberAuthor

    Client 9677 and exact callback putio://auth are now proven end to end with both installable mobile identities present. Auth Tab returned to the production initiating Activity, nightly remained signed out with isolated storage, production restored its session, and Android exposed zero callback handlers. Evidence: https://attach.uinaf.dev/p/Vn4CkKxiY887tK0vCc75ZQ

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