Can not add account for custom Sonos service

这一生的挚爱 提交于 2019-12-04 05:48:03

问题


I've created a Sonos music service and added it to my speaker with customsd. Both endpoint urls (regular and secure) are available. The service is successfully added to the speaker.

With SoapUI I can send a https request for GetSessionId and it returns a valid response.

I use sessionId authentication, so when I want to add my account to the service in Sonos, the service asks for a username and a password. After filling in, I get a connection error. Problem with adding account. Connection can not be made.

The problem is, I expect a 'GetSessionId' request entering my music service (So I can debug the request), but it seems nothing comes in.

Can anyone tell me why or what is happening?


回答1:


Are you setting the authentication type to Session ID when you're adding the service from customsd?

Here is an example of how the function should look like (in PHP):

public function getSessionId($args)
{
    $user = $args->username;
    $pass = $args->password;
    //Check the user and pass in your service
    //if login successful, set $sessionId to the session ID of the user
    //else if login unsuccessful, throw new SoapFault('Client.LoginInvalid','Client.LoginInvalid');
    return array('getSessionIdResult' => $sessionId);
}


来源:https://stackoverflow.com/questions/31881695/can-not-add-account-for-custom-sonos-service

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!