sonos

SONOS auth token is not being sent in Authorization HTTP header for CQ API calls


I followed the Sonos docs for adding app authentication and the page for using authentication tokens and the result is that the SMAPI server correctly returns an authToken together with a privateKey back to the controller. I can see the authToken being present in the credentials header inside the SOAP messages sent to my SMAPI server.

However, despite the many mentions of this inside the Sonos docs pages related to HTTP requests (I will list the resources links down below), the same authToken is not being sent inside the HTTP header Authorization, this making my CQ server unable to validate requester identity.

I tried the following, without success:

From Sonos device:

X-Sonos-Playback-Id: RINCON_48??????D201400:3165321802 <= deviceId inserted after RINCON_

X-Sonos-Device-Id: Sonos_U????????????????????????6 <= householdId

X-Sonos-Corr-Id: 267e3e0c-75ca-4b9d-8be4-b8a795a462a3 <= unique each time

From macOS Controller:

X-Sonos-Controller-ID: 68:??:??:??:??:07 <= the same each time

X-Sonos-Api-Key: 8??????e-7??7-4??f-b??6-7??????????0 <= the same each time

X-Sonos-Corr-Id: 648ec896-e043-44f8-bfba-cd0a80c9d857 <= unique each time

The docs links I mentioned above that refer the presence of the auth token inside the HTTP Authorization header are the following:

But the most clear mention is in the page about HTTP requests, because it's not particular just for the CQ API endpoints but for all HTTP endpoints, even those hosted by the SMAPI server itself. The page reads the following 2 excerpts:

first extended mention

and

second extended mention

To conclude, with so many mentions of it in the official Sonos docs, why isn't this essential header being transmitted in the HTTP Authorization header? And how should a CQ verify the identity of the requester without the presence of this authToken on each API method request?


Solution

  • The auth token is sensitive information and will not be included in the HTTP headers if it's being sent to an endpoint that is insecure.

    Try again with your CQ server behind an https:// address.