FAQ  •  Register  •  Login

CDS Login prolbem

<<

GhostMaster75

Serviio newbie

Posts: 1

Joined: Mon May 04, 2015 1:50 pm

Post Mon May 04, 2015 2:02 pm

CDS Login prolbem

Hi,
I'm trying to use the API with PHP but are still at login.
He keeps telling me that my password is incorrect but does not with response 552.

this is my code:
  Code:
$data = date("D, d M Y H:i:s e");
$pass = "mypass";
$string = hash_hmac("sha1", $data, $pass);
$password = base64_encode($string);

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://localhost:23424/cds/login");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array("Accept: application/xml | application/json", "Date: " . $data, "X-Serviio-Date: " . $data,  "Authorization: Serviio " . $password));
$response = curl_exec($ch);
curl_close($ch);

var_dump($response);


what's wrong???

thank you
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16256

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Tue May 05, 2015 4:35 pm

Re: CDS Login prolbem

the Accept header must be either application/xml or application/json
<<

wasant

Serviio newbie

Posts: 2

Joined: Wed Mar 15, 2017 2:00 am

Post Wed Mar 29, 2017 2:45 pm

Re: CDS Login prolbem

Hi ,
I found this problem as well --> '{"errorCode":552}'

my code below:

$data = gmdate('D, d M Y H:i:s T');
$pass = "1234"; // This password I set with GUI Console in Remote menu.
$string = hash_hmac("sha1", $data, $pass);
$password = base64_encode($string);


$ch = curl_init();

curl_setopt($ch, CURLOPT_URL, "http://localhost:23424/cds/login");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
curl_setopt($ch, CURLOPT_HEADER, FALSE);
curl_setopt($ch, CURLOPT_POST, TRUE);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
"Accept: application/json",
"Date: ".$data,
"X-Serviio-Date:".$data,
"Authorization:Serviio ".$password
));

what's wrong?

thank you
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16256

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Wed Mar 29, 2017 6:56 pm

Re: CDS Login prolbem

does this code produce the example value specified in the API docs?
<<

wasant

Serviio newbie

Posts: 2

Joined: Wed Mar 15, 2017 2:00 am

Post Thu Mar 30, 2017 2:14 am

Re: CDS Login prolbem

zip wrote:does this code produce the example value specified in the API docs?


Yes,I followed the example in the API documentation.
I'm a beginner. I'm not sure in the steps below.

Calculating the Signature
Calculating the value to include in the request is a simple procedure.
1.Calculate an RFC 2104-compliant HMAC-SHA1 hash, using the string (see 4.3.2) and the user's password as the key.
2.Convert the resulting value to base64.
3.The result is the signature you include in the request.

my code below , I'm doing it right?

$data = gmdate('D, d M Y H:i:s T');
$pass = "1234"; // This password I set with GUI Console in Remote menu.
$string = hash_hmac("sha1", $data, $pass);
$password = base64_encode($string);


Do you have any suggestions or samples for me?

Thanks in advance for your help.
<<

zip

User avatar

Serviio developer / Site Admin

Posts: 16256

Joined: Sat Oct 24, 2009 12:24 pm

Location: London, UK

Post Thu Mar 30, 2017 8:04 am

Re: CDS Login prolbem

it looks ok to me. Do you get the right value when you use the date and password defined in the API ocs as an example? (search for "The following table shows a string, a fake Secret Access Key, and what the resulting base64 encoded signature would be.")

Return to Third-party tools integration

Who is online

Users browsing this forum: No registered users and 2 guests

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.