生成的授权的二维码链接如下:
https://open.work.weixin.qq.com/3rdapp/install?suite_id=ww1d4e893359418def&pre_auth_code=lKEPdtvanMCSxaKba4RETZEVnrXIHI8WEIwlLNPw7MxwYzlNIBcUMPZMx6lWQglu&redirect_uri=https://wkbbgray.natapp4.cc/api/wx/v1/cpopen/callbackForPreAuth&state=STATE
打开链接时,二维码页面提示preauthcode校验失败。在生成这链接时,也调用了设置授权配置接口(设置auth_type为0或1均有此问题)。
请问是什么原因,谢谢
生成二维码JAVA代码如下:
String redirectURI = serviceConfig.getHost() + "/api/wx/v1/cpopen/callbackForPreAuth";
String preAuthCode = wxCpOpenInitService.getWxCpTpService().getPreAuthCode();
log.info("******preAuthCode:{}*******",preAuthCode.toString());
wxCpOpenInitService.getWxCpTpService().setSessionInfo(preAuthCode);
StringBuilder preAuthUrl = new StringBuilder("https://open.work.weixin.qq.com/3rdapp/install");
preAuthUrl.append("?suite_id=");
preAuthUrl.append(wxCpOpenInitService.getCpTpRedisConfigStorage().getSuiteId());
preAuthUrl.append("&pre_auth_code=");
preAuthUrl.append(preAuthCode);
preAuthUrl.append("&redirect_uri=");
preAuthUrl.append(redirectURI);
preAuthUrl.append("&state=");
preAuthUrl.append("STATE");
log.info("******preAuthUrl:{}*******",preAuthUrl.toString());
您好,第三方授权安装链接需要配置授权配置https://open.work.weixin.qq.com/api/doc/90001/90143/90602
这个安装的url不能直接点的,必须要从对应的域名xxx.com跳过来,referer的域名必须是安装回调域名(与第三方应用详情页上域名一致)xxx.com。且测试安装需要设置对应的测试授权 https://work.weixin.qq.com/api/doc#10975/%E8%AE%BE%E7%BD%AE%E6%8E%88%E6%9D%83%E9%85%8D%E7%BD%AE
我的也出现这种问题,不知道是怎么回事,完成回调域名也设置了,授权配置也请求成功了