Prakash S
Prakash S

Reputation: 652

Sonos applink based authentication issue

Trying to add out sonos service will show Authorize" screen for a fraction of a second before it goes away stating "account not found" before I even have time to put in an account. Below are the request for applink and resonse. Any thing else is required to make it remain in the authorize screen

    //request
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.sonos.com/Services/1.1">
       <soapenv:Header>
          <ns:context>
          </ns:context>
          <ns:credentials>
          </ns:credentials>
       </soapenv:Header>
       <soapenv:Body>
          <ns:getAppLink>
             <ns:householdId>Sonos_ghsAflSonosakevCzmxcmFhN7pN</ns:householdId>
             <ns:hardware>iPhone8,2</ns:hardware>
             <ns:osVersion>Version 9.3.3 (Build 13G34)</ns:osVersion>
             <ns:sonosAppName>ICRU_iPhone8,2</ns:sonosAppName>
             <ns:callbackPath>sonos://x-callback-url/addAccount?state=sid%3D61703%26OAuthDeviceID%3DSonos_ghsAflSonosakevCzmxcmFhN7pN%26callbackPath%3D%2FaddAccount</ns:callbackPath>
          </ns:getAppLink>
       </soapenv:Body>
    </soapenv:Envelope>



    //response
    <?xml version="1.0" encoding="utf-8"?>
    <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"  xmlns:tns="http://www.sonos.com/Services/1.1">
        <soap:Body>
            <getAppLinkResponse xmlns="http://www.sonos.com/Services/1.1">
                <getAppLinkResult>
                    <authorizeAccount>
                        <appUrlStringId>LAUNCH_APP</appUrlStringId>
                        <deviceLink>
                            <regUrl>https://ourserver.com/#/signin?callbackurl=sonos://x-callback-url/add…
                            <linkCode>Sonos_ghsAflSonosakevCzmxcmFhN7pN</linkCode>
                            <showLinkCode>false</showLinkCode>
                        </deviceLink>
                    </authorizeAccount>
                </getAppLinkResult>
            </getAppLinkResponse>
        </soap:Body>
    </soap:Envelope>

Upvotes: 0

Views: 126

Answers (1)

Nancy Hernandez
Nancy Hernandez

Reputation: 50

The experience you are describing is what would happen if you are not properly returning the ‘NOT_LINKED_RETRY’ fault. As described in the documentation, https://musicpartners.sonos.com/node/405 (search for polling). While your service waits for the user to manually log in through the browser, it should provide to the getDeviceAuthToken call the ‘NOT_LINKED_RETRY’ fault response for a few minutes. Details for this fault can be found here: https://musicpartners.sonos.com/node/292.

Upvotes: 3

Related Questions