Implementing Authentication

Providing for new user accounts to your service

If the user does not have an account with your service, you can choose to provide the user with a link to create one. In your response to getAppLink, include the <createAccount> element. This instructs the Sonos app to present to the user a button for opening your app and creating an account on your service. The following shows the Sonos app screens to initiate this process:

When the user selects "Add Account", the Sonos app sends your service a getAppLink request. In order for your service to provide the two options shown in the right-most screen, your service's response to getAppLink should be similar to the following. The <appUrl> of <authorizeAccount> provides the link into your app's sign-in workflow, and the <appUrl> of <createAccount> provides the link into your app's new-account workflow. 

. . .
<s:Envelope xmlns:s="" xmlns:ns="">
         <getAppLinkResult xsi:type="appLinkResult" xmlns:xsi="">

We encourage you to direct users to your app for both the sign-in and create-account workflows. However, if the user does not have the app installed, Sonos will use the sign-in URL you provided to Sonos in the version manager (see Listing your music service in the Service Catalog for details). If you want to restrict the user to create an account using only a Web page and not your app, leave out the <appUrl> sub-element in the <createAccount> element:

. . .
. . .

You can still include the <appUrlStringId> element if you don't provide <appUrl>. This way you can still customize the signup button.