-
-
Notifications
You must be signed in to change notification settings - Fork 8.8k
WxMaUserServiceImpl#checkUserInfo 解密失败 #1291
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
Comments
请先阅读下置顶区的问题:#359 |
执行 final String generatedSignature = DigestUtils.sha1Hex(rawData + sessionKey); 的时候并没有出错。 错误用户的日志信息: 现在怀疑,是不是 nickName 包含特殊字符,导致传输 做了什么处理,导致服务器加密比较失败。 |
#876 看起来跟这个问题是类似的? |
看情况有些类似。暂时还没有复现,所以不能确定。 |
这个问题很有趣,最近没人反应有此问题了吧?暂时关闭 |
依旧出现这个问题。。。 |
请描述清楚你的问题,单独开个issue,谢谢 |
简要描述
前端通过wx.login获取code,然后再调用getUserInfo获取加密的用户信息。一次性把参数传入服务端。
服务端先用code置换sessionKey,然后用sessionKey解密用户信息。一直解密失败。
public boolean checkUserInfo(String sessionKey, String rawData, String signature) {
final String generatedSignature = DigestUtils.sha1Hex(rawData + sessionKey);
return generatedSignature.equals(signature);
}
返回 false
官网有说,先调用login会刷新登陆状态,所以,要先 getUserInfo 需要在login之后。目前的流程已经是在 login之后,但是还是会偶有出现解密用户信息失败的情况 。
模块版本情况
The text was updated successfully, but these errors were encountered: