iOS: native API client, credentials in the keychain #419

Closed
opened 2026-11-08 10:06:53 -08:00 by rays · 3 comments
Owner

The app's only credential is the web view's Cloudflare Access cookie; when it expires mid-drive playback stops with 'Sign in again' (ios/README.md, Not yet). Send an ipx API token (Authorization: Bearer) plus a Cloudflare Access service token (CF-Access-Client-Id / CF-Access-Client-Secret), all kept in the keychain, from the player's requests. Needed by CarPlay, which has no web view.

The app's only credential is the web view's Cloudflare Access cookie; when it expires mid-drive playback stops with 'Sign in again' (ios/README.md, Not yet). Send an ipx API token (Authorization: Bearer) plus a Cloudflare Access service token (CF-Access-Client-Id / CF-Access-Client-Secret), all kept in the keychain, from the player's requests. Needed by CarPlay, which has no web view.
rays added the enhancement label 2026-11-08 10:06:53 -08:00
Author
Owner

Fixed in f6042e9 and 7d4456b: Credentials.swift keeps an ipx API token and a Cloudflare Access service token in the keychain, and the player sends them on its audio, position, read-flag and artwork requests; shake, Player Tokens enters them. The ipodderx Access application got a Service Auth policy for the ipx-ios service token. Checked on a phone: it plays. In TestFlight build 2 (iOS 0.1.0).

Fixed in f6042e9 and 7d4456b: Credentials.swift keeps an ipx API token and a Cloudflare Access service token in the keychain, and the player sends them on its audio, position, read-flag and artwork requests; shake, Player Tokens enters them. The ipodderx Access application got a Service Auth policy for the ipx-ios service token. Checked on a phone: it plays. In TestFlight build 2 (iOS 0.1.0).
rays closed this issue 2026-11-08 10:43:11 -08:00
Author
Owner

Reopened: closed on 'it plays', which a cookie-only player also does. Reworked in 3626a30: one API token sent to https://ipxapi.sdf1.net (tunnel route, no Access, Cloudflare firewall rule limiting it to the app's paths; see docs/sso.md). Server side checked: no bearer 403, off-list paths 403, bad bearer 401 from ipx. Not yet checked on a phone with the token set and the page signed out. Build 4.

Reopened: closed on 'it plays', which a cookie-only player also does. Reworked in 3626a30: one API token sent to https://ipxapi.sdf1.net (tunnel route, no Access, Cloudflare firewall rule limiting it to the app's paths; see docs/sso.md). Server side checked: no bearer 403, off-list paths 403, bad bearer 401 from ipx. Not yet checked on a phone with the token set and the page signed out. Build 4.
rays reopened this issue 2026-11-08 11:11:06 -08:00
Author
Owner

Checked on the phone with TestFlight build 14: works.

Checked on the phone with TestFlight build 14: works.
rays closed this issue 2026-11-13 05:44:13 -08:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: rays/ipx#419