Comments (5)
不太明白你的意思,“发现微信的 signature是用token,timestamp和noncestr三个参数计算的,与其文档里的说明并不一致” 这句话怎么理解?
from wxjava.
我感觉你应该是概念上有所混淆导致这个问题,WxCryptUtil是消息加密用的,而signature是校验消息来源的,不是一个东西
from wxjava.
`
try {
WxMpXmlMessage xmlMessage = WxMpXmlMessage.fromEncryptedXml(message, wxMpService.getWxMpConfigStorage(),timestamp, nonce, signature);
if (WxConsts.XML_MSG_DEVICE_EVENT.equals(xmlMessage.getMsgType())) {
if (LOG.isDebugEnabled()) {
LOG.debug("device event");
}
String openId = xmlMessage.getFromUser();
String deviceId = xmlMessage.getDeviceId();
rentalService.bindDevice(deviceId, openId);
}
} catch (Exception e) {
LOG.warn(e.getMessage());
}
我是这样调用的。报错:
WARN RootController:186 - 加密消息签名校验失败`
debug时,发现SHA1.gen(new String[]{this.token, timeStamp, nonce,cipherText})计算的结果与signature不一致,若只用前三个参数计算token,timeStamp,nonce计算,则与微信的signature一致。
from wxjava.
你确实是搞错了,signature那个是验证消息是否是微信服务器发送过来用的。建议你参考下demo中的实现方法,具体看首页中提供的几个demo即可,或者看wiki中的相关内容
from wxjava.
是的,是我搞错了。这个位置,我应该使用msg_signature。在向微信测试号的请求里,并没有msg_signature这个参数。哭
from wxjava.
Related Issues (20)
- WxMpApiUrl getUrl方法抛出'java.lang.reflect.InaccessibleObjectException'异常 HOT 3
- 我看到有 springboot 的适配版本,是不是也可以有 solon 的适配版本? HOT 4
- WxMaEntrustRequest 中version字段必填,但是小程序纯签约场景,会带上version加签,导致最终拉不起签约页面(参数构造错误,请联系商家处理) HOT 2
- BaseWxPayResult类checkResult时,是否校验结果或如果结果不正确,是否打error日志,应该支持可配置。 HOT 4
- 由于公众号和小程序有多个weixin-java-mp 能否支持类似 wx-java-cp-multi-spring-boot-starter 的能力 HOT 1
- 小程序图片异步检测mediaCheckAsync方法调用异常 HOT 2
- 微信支付签名校验失败 HOT 2
- 传运单接口 trace_waybill 缺少参数 HOT 1
- 支付退款回调验签错误 HOT 2
- 企业微信-修改客户备注信息-无法清空全部备注手机号码 HOT 1
- me.chanjar.weixin.cp.constant.WxCpApiPathConsts.OAuth2#GET_USER_DETAIL 4.6.0 路径与源码不一致 HOT 3
- 视频号新增会员相关API
- 修改initApiV3HttpClient代码中的自动更新证书url地址 HOT 1
- 获取登录后的session信息方法容易出现敏感信息泄露问题 HOT 3
- haveOpen()调用url地址错误
- 使用wx-java-pay-spring-boot-starter时,不配置v3相关配置会报错 HOT 2
- Caused by: redis.clients.jedis.exceptions.JedisDataException: NOPERM this user has no permissions to run the 'eval' command or its subcommand HOT 2
- refundqueryv2的 WxPayRefundQueryResult 定义错误 HOT 2
- 4.6.0 构造v3 下单方法createOrderV3 中的 入参 WxPayUnifiedOrderV3Request 时,Discount
- max amount字段类型过小
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wxjava.