如何生成PHP QuickBlox验证签名? [英] How to generate QuickBlox authentication signature in PHP?
问题描述
我要访问QuickBlox API的,但在这之前,我们需要验证我们的应用程序,并得到一个会话令牌,并使用会话令牌,我们可以访问其他的API。
但问题是,当我使用的QuickBloxwebsite给出的规格要求发送验证请求,我收到错误消息:
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"]}}
生成签名的参数是:
application_id=22&auth_key=wJHd4cQSxpQGWx5&nonce=33432×tamp=1326966962
然后我们把它转换的HMAC-SHA格式:
And then we convert it in HMAC-SHA format:
hash_hmac( 'sha1', $signatureStr , $authSecret);
请帮我解决这个问题。
Please help me to resolve this problem.
推荐答案
问题解决了
有在我的请求参数有问题。
There was a problem in my request parameters.
$params = "application_id=$application_id&auth_key=$auth_key×tamp=$timestamp&nonce=$nonce&signature=$signature&**auth_secret=$authSecret**";
在这个参数我经过一个额外的参数,我的身份验证密钥
应不应该存在。我删除了这个参数,现在它的工作。
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.
这篇关于如何生成PHP QuickBlox验证签名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!