gotta store my records

Evaluate a token-mediating backend for longer iOS OAuth sessions #172

Open mokkenstorm.dev
Open opened by mokkenstorm.dev

ADR 5 makes the iOS app an untrusted public atproto OAuth client. The atproto OAuth spec says such clients should get sessions and refresh tokens limited to 2 weeks, while confidential clients may have unlimited sessions with 180-day refresh tokens (https://atproto.com/specs/oauth, "Tokens and Session Lifetime"). The two-week limit is accepted for the first release.

The spec also allows a mobile app and a token-mediating backend to form one confidential client ("Types of Clients"). This issue tracks evaluating that as the way to longer sessions: the crate server would hold the client signing key and authenticate token and refresh requests, while the DPoP key stays in the device's Secure Enclave.

Questions to settle:

  • Can token requests be mediated without the server ever holding the tokens, or does it see them in transit?
  • Does every refresh then depend on crate being reachable, and what happens offline?
  • Key rotation and revocation through the advertised JWKS for an app-plus-backend client.
  • Whether real users actually hit the two-week re-login often enough to justify it.
Sign up or Sign in to add to the discussion.