- 小程序getuserencryptkey invalid signature?
参数: access_token:75_gEaJ6FVh4U0_T4atz5HrDg0cSOQykKIyozZbxK1p2iYTzOKtExG-Fa0OYBophybNCF82wHcqz_PIS96dxmNIuvKS4bML5-t_QxjC5dJj4wbigCNUVAjerrhQzsURHYbAGAVLC openid:oZeIR0WhrKYK4sUde-ETXObpc-I0 signature:50caaa4f05bba1efae62481513d09c659081c873134711cbc0d5fd40d5e003f7 sig_method:hmac_sha256 执行结果: { "errcode": 87009, "errmsg": "invalid signature rid: 656eed48-7a430bd4-2b0aa80f", "key_info_list": [] } 我确认access_token、openid都是正确无误的,signature的实现代码如下: public static void main(String[] args) { try { String secretKey = "vTLGsnYI6fqOFqRmTocWlQ=="; // 替换为实际的密钥 String data = ""; // 空串 // 使用HMAC SHA-256算法 Mac sha256Hmac = Mac.getInstance("HmacSHA256"); SecretKeySpec secretKeySpec = new SecretKeySpec(secretKey.getBytes(StandardCharsets.UTF_8), "HmacSHA256"); sha256Hmac.init(secretKeySpec); // 计算HMAC值 byte[] hmacBytes = sha256Hmac.doFinal(data.getBytes(StandardCharsets.UTF_8)); // 将HMAC值转换为小写的hex字符串 StringBuilder hexStringBuilder = new StringBuilder(); for (byte b : hmacBytes) { hexStringBuilder.append(String.format("%02x", b)); } String hexHmac = hexStringBuilder.toString(); System.out.println("HMAC SHA-256: " + hexHmac); } catch (NoSuchAlgorithmException | InvalidKeyException e) { e.printStackTrace(); } } 尝试了很多遍,大写小写各种都试过了,就是不行,invalid signature,恳请官方有没有人给看一看,找不到其他问题了,也不知道那从哪开始排查问题了
2023-12-05 - 小程序 getUserEncryptKey invalid signature?
https://api.weixin.qq.com/wxa/business/getuserencryptkey?access_token=75_Z80V_-_Tqd9pLYXdVvr8UfbwVAPOEC36h6jbE9z35IWtlCCEXcNr8P3NUXBNLAMOUZFUIAM2Qhg5ri6HIteK4WqtjkP9b_J9cuOJLvejlS5cPgTB4iqhwf8TU9cAFUeADAJOD 参数: access_token:75_Z80V_-_Tqd9pLYXdVvr8UfbwVAPOEC36h6jbE9z35IWtlCCEXcNr8P3NUXBNLAMOUZFUIAM2Qhg5ri6HIteK4WqtjkP9b_J9cuOJLvejlS5cPgTB4iqhwf8TU9cAFUeADAJOD openid:oZeIR0WhrKYK4sUde-ETXObpc-I0 signature:ab9193c40b5ffb84bda074d8468caf5981fa9990f5b46736b2e01100fe6a7a05 sig_method:hmac_sha256 [图片]
2023-12-05 - 小程序ios运行正常但安卓机器真机运行报错?
[图片] 使用:"marked": "4.3.0"这个版本就不会有问题了
2023-08-16 - appid和openid不匹配
找了一堆官方文档也没见有啥解决方案,希望官方尽快解决此问题
2020-11-03