如何生成PHP QuickBlox验证签名? [英] How to generate QuickBlox authentication signature in PHP?

查看:167
本文介绍了如何生成PHP QuickBlox验证签名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要访问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&timestamp=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&timestamp=$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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆