We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
企业微信OAuth2.0缺少snsapi_userinfo和snsapi_privateinfo
@Override public String buildAuthorizationUrl(String redirectUri, String state) { String url = "https://open.weixin.qq.com/connect/oauth2/authorize?"; url += "appid=" + this.mainService.getWxCpConfigStorage().getCorpId(); url += "&redirect_uri=" + URIUtil.encodeURIComponent(redirectUri); url += "&response_type=code"; url += "&scope=snsapi_base"; if (state != null) { url += "&state=" + state; } url += "#wechat_redirect"; return url; }
weixin-java-cp中WxCpOAuth2ServiceImpl类
@Override public String[] getUserInfo(Integer agentId, String code) throws WxErrorException { String url = String.format("https://qyapi.weixin.qq.com/cgi-bin/user/getuserinfo?code=%s&agentid=%d", code, agentId); String responseText = this.mainService.get(url, null); JsonElement je = new JsonParser().parse(responseText); JsonObject jo = je.getAsJsonObject(); return new String[]{GsonHelper.getString(jo, "UserId"), GsonHelper.getString(jo, "DeviceId"), GsonHelper.getString(jo, "OpenId")}; }
中得到的userTicket没有返回 无法调用 getUserDetail(String userTicket)
The text was updated successfully, but these errors were encountered:
注意:企业自建应用可以根据userid获取成员详情,无需使用snsapi_userinfo和snsapi_privateinfo两种scope。 企业成员可以用userid通过通讯录相关接口得到用户信息 但是非企业成员授权时只能得到openId,我觉得这两个会有用
Sorry, something went wrong.
非常感谢及时提出。看了下,你应该是提了两个问题,以后最好每个问题单独提吧。
#697 企业微信OAuth2.0增加对snsapi_userinfo和snsapi_privateinfo的支持
c29a3e5
3.1.4.BETA测试版本 已增加相关支持。
No branches or pull requests
企业微信OAuth2.0缺少snsapi_userinfo和snsapi_privateinfo
weixin-java-cp中WxCpOAuth2ServiceImpl类
中得到的userTicket没有返回
无法调用
getUserDetail(String userTicket)
The text was updated successfully, but these errors were encountered: