Skip to content

[Architecture] Investigate Amazon Code-Based Linking (amazon.<tld>/code) for browserless login #2177

Open

Description

@wtanksleyjr

Context

Part of a set of [Architecture] proposals for decoupling Libation's core engine from OS-specific UI/browser dependencies.

Problem

Most of Libation's OS-specific login headaches (WebView2 0x800700AA, blank login dialogs, libwebkit2gtk 200+ package bloat in Linux/Docker) come from embedding a browser inside the C# GUI process. Meanwhile, the external-browser redirect flow (maplanding) confuses users with "page not found" errors and 2FA intermediate URLs.

Proposal

Investigate Amazon's Code-Based Linking (amazon.<tld>/code, i.e., POST /auth/create/codepair + polling POST /auth/register), as demonstrated in mkb79/Audible#906 (cmd_test-login.py):

  • User opens https://www.amazon.<tld>/code in any browser and enters a 5-character code while Libation polls for registration completion.
  • Works identically across CLI, headless/Docker, Web UI, Avalonia, WinForms, and screenreaders.

Experiments needed before committing

  1. Test whether api.amazon.{domain}/auth/create/codepair accepts CurrentAndroid's DeviceType (or only iPhone A2CZJZGLK2JJVM / Fire).
  2. Verify whether Widevine CDM and /1.0/content/{asin}/licenserequest accept CBL-issued bearer + mac_dms tokens without store_authentication_cookie.
  3. Keep the existing redirect-URL flow only as a fallback for legacy pre-amazon (us/uk/de) accounts.

Activity

  1. wtanksleyjr commented on Nov 20, 2026

    @wtanksleyjr
    ContributorAuthor

    Update from @mkb79 in mkb79/Audible#909 (comment 7031128597): /auth/create/codepair + /auth/register should theoretically work with all device types including Android — testing it in cmd_test-login.py only requires swapping DEVICE_TYPE, REGISTRATION_DATA, and USER_AGENT to Libation's Android profile (untested on Android so far).

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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions