Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信开发平台接受消息报Invalid request signature bug #625

Closed
jekst opened this issue Mar 30, 2017 · 2 comments
Closed

微信开发平台接受消息报Invalid request signature bug #625

jekst opened this issue Mar 30, 2017 · 2 comments

Comments

@jekst
Copy link
Contributor

jekst commented Mar 30, 2017

我用的环境

PHP 版本:5.6 7
overtrue/wechat 版本:3.2

问题及现象

开发平台代码里接受微信服务器推送的ticket或其他信息时报Invalid request signature bug
处理信息代码:
$openPlatform->server->serve();

serve方法里有个验证前面的方法validate
public function validate($token)
{
$params = [
$token,
$this->request->get('timestamp'),
$this->request->get('nonce'),
];
if (!$this->debug && $this->request->get('signature') !== $this->signature($params)) {
throw new FaultException('Invalid request signature.', 400);
}
}
参与签名的参数缺少
encrypt_type
msg_signature
正确的是
public function validate($token)
{
$params = [
$token,
$this->request->get('timestamp'),
$this->request->get('nonce'),
$this->request->get('encrypt_type'),
$this->request->get('msg_signature'),
];
if (!$this->debug && $this->request->get('signature') !== $this->signature($params)) {
throw new FaultException('Invalid request signature.', 400);
}
}

@bolechen
Copy link

请问这个问题后来怎么解决的?我碰到了同样的问题

@ghost
Copy link

ghost commented Oct 11, 2019

这个问题我今天又遇到了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants