1
0
mirror of synced 2026-04-27 03:58:41 +08:00

🚑 增加alipay授权参数的验证,修改部分命名

This commit is contained in:
yadong.zhang
2019-06-19 16:48:09 +08:00
parent 25424023c4
commit 65daa0592a
3 changed files with 15 additions and 5 deletions

View File

@@ -34,11 +34,11 @@ public class AuthDingTalkRequest extends BaseAuthRequest {
protected AuthUser getUserInfo(AuthToken authToken) {
String code = authToken.getAccessCode();
// 根据timestamp, appSecret计算签名值
String stringToSign = System.currentTimeMillis() + "";
String urlEncodeSignature = GlobalAuthUtil.generateDingTalkSignature(config.getClientSecret(), stringToSign);
String timestamp = System.currentTimeMillis() + "";
String urlEncodeSignature = GlobalAuthUtil.generateDingTalkSignature(config.getClientSecret(), timestamp);
JSONObject param = new JSONObject();
param.put("tmp_auth_code", code);
HttpResponse response = HttpRequest.post(UrlBuilder.getDingTalkUserInfoUrl(urlEncodeSignature, stringToSign, config.getClientId()))
HttpResponse response = HttpRequest.post(UrlBuilder.getDingTalkUserInfoUrl(urlEncodeSignature, timestamp, config.getClientId()))
.body(param.toJSONString())
.execute();
String userInfo = response.body();