收藏
回答

生成安装授权二维码链接提示preauthcode校验失败

生成的授权的二维码链接如下:

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为01均有此问题)。

请问是什么原因,谢谢

生成二维码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());


回答关注问题邀请回答
收藏

2 个回答

登录 后发表内容
问题标签