Bose SoundTouch Toolkit

Documentation for controlling and preserving Bose SoundTouch devices

View the Project on GitHub gesellix/Bose-SoundTouch

Spotify Account Addition Implementation Status

To fully replace Bose cloud services for the Spotify account addition flow in the “Stockholm” SoundTouch application, the following routes have been implemented in the soundtouch-service:

1. OAuth Token Exchange (Bose Cloud)

The Stockholm background worker (in worker_common.js and spotify_worker.js) performs a token exchange using an authorization code.

2. Cloud Source Registration (Marge Service)

The SoundTouch application registers a new music source (e.g., Spotify) with the Bose cloud profile.

3. Redirect Handling (Browser to App)

The soundtouch:// deep link redirect URI is handled by the management interface which provides the OAuth callback.

Implementation Details

  1. Marge Add Source:
    • HandleMargeAddSource in pkg/service/handlers/handlers_marge.go parses the incoming XML and persists the new source to the DataStore for the corresponding account.
  2. OAuth Account Token Exchange:
    • HandleBoseAccountToken in pkg/service/handlers/handlers_oauth.go supports the /oauth/account/.../token/cs path.
    • It responds with a JSON payload including access_token and token_type “Bearer” after exchanging the code via ExchangeCodeAndStore.
  3. Router Registration:
    • These paths are registered in cmd/soundtouch-service/main.go within the /streaming, /oauth, and /mgmt route blocks.