I want to access the APIs in QuickBlox, but before that we need to authenticate our apps and get a session token, and using session token we can access the other APIs. But the problem is, when I send the authentication request using the required specification given on the QuickBloxwebsite, I am getting the error message:
{"errors":{"base":["Unexpected signature"]}}
The parameters to generate the signature is:
application_id=22&auth_key=wJHd4cQSxpQGWx5&nonce=33432×tamp=1326966962
And then we convert it in HMAC-SHA format:
hash_hmac( 'sha1', $signatureStr , $authSecret);
Please help me to resolve this problem.
Problem solved
There was a problem in my request parameters.
In this parameter I was passing an extra parameter,
my auth secret key
which should not be there. I removed this parameter and now its working.1) You should send request to correct url.
to https://api.quickblox.com/auth.json
instead https://api.quickblox.com/session.json
2) You should fix SSL problem using this.
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false)
Here is full example how to create QuickBlox session:
We use php, and next code works well for us:
I wrote code snippet on php, it generates signature. It works good
this is my test application's credentials:
hope this help
You have to use your own application parameters:
and random 'nonce' and current timestamp (not from example, you can get current timestamp on this site http://www.unixtimestamp.com/index.php)
Your code is right, but you must set proper parameters