提交 e5e47c5e 编写于 作者: Chongwen.jiang's avatar Chongwen.jiang

日志添加打印.

上级 4839d1f4
流水线 #22124 已失败 于阶段
in 1 second
...@@ -662,7 +662,8 @@ public class LoginServiceImpl implements LoginService { ...@@ -662,7 +662,8 @@ public class LoginServiceImpl implements LoginService {
appleResp = HttpClientCloudUtils.getHttpExecute(Constants.APPLE_GET_PUBLIC_KEY_URL); appleResp = HttpClientCloudUtils.getHttpExecute(Constants.APPLE_GET_PUBLIC_KEY_URL);
//logger.info("checkIdentifyToken-appleResp:{}", appleResp); //logger.info("checkIdentifyToken-appleResp:{}", appleResp);
} catch (Exception e) { } catch (Exception e) {
throw new PicaException("获取公钥失败", e.getMessage()); logger.info("checkIdentifyToken-get apple public key fail");
throw new PicaException("get apple public key fail Exception", e.getMessage());
} }
JSONObject jsonObject = JSONObject.parseObject(appleResp); JSONObject jsonObject = JSONObject.parseObject(appleResp);
String keys = jsonObject.getString("keys"); String keys = jsonObject.getString("keys");
...@@ -676,7 +677,7 @@ public class LoginServiceImpl implements LoginService { ...@@ -676,7 +677,7 @@ public class LoginServiceImpl implements LoginService {
Jwk jwa = Jwk.fromValues(jsonObject1); Jwk jwa = Jwk.fromValues(jsonObject1);
publicKey = jwa.getPublicKey(); publicKey = jwa.getPublicKey();
} catch (Exception e) { } catch (Exception e) {
throw new PicaException("生成publicKey失败", e.getMessage()); throw new PicaException("checkIdentifyToken-generate publicKey fail", e.getMessage());
} }
// 分割前台传过来的identifyToken(jwt格式的token)用base64解码使用 // 分割前台传过来的identifyToken(jwt格式的token)用base64解码使用
if (identifyToken.split("\\.").length > 1) { if (identifyToken.split("\\.").length > 1) {
...@@ -690,7 +691,8 @@ public class LoginServiceImpl implements LoginService { ...@@ -690,7 +691,8 @@ public class LoginServiceImpl implements LoginService {
// appleUserId从token中解码取出后赋值 // appleUserId从token中解码取出后赋值
request.setAppleUserId(sub); request.setAppleUserId(sub);
} catch (Exception e) { } catch (Exception e) {
throw new PicaException("token格式错误", e.getMessage()); logger.info("checkIdentifyToken-token decode fail" + e.getMessage());
throw new PicaException("checkIdentifyToken-token decode fail Exception", e.getMessage());
} }
return this.verify(publicKey, identifyToken, aud, sub, request); return this.verify(publicKey, identifyToken, aud, sub, request);
} }
...@@ -711,9 +713,9 @@ public class LoginServiceImpl implements LoginService { ...@@ -711,9 +713,9 @@ public class LoginServiceImpl implements LoginService {
jwtParser.requireAudience(audience); jwtParser.requireAudience(audience);
jwtParser.requireSubject(subject); jwtParser.requireSubject(subject);
try { try {
logger.info("apple-verify-starting"); logger.info("checkIdentifyToken-apple-verify-starting");
Jws<Claims> claim = jwtParser.parseClaimsJws(jwt); Jws<Claims> claim = jwtParser.parseClaimsJws(jwt);
logger.info("apple-verify-claim:{}", JSON.toJSONString(claim)); logger.info("acheckIdentifyToken-apple-verify-claim:{}", JSON.toJSONString(claim));
//logger.info("apple-verify-claim.getBody:{}", JSON.toJSONString(claim.getBody())); //logger.info("apple-verify-claim.getBody:{}", JSON.toJSONString(claim.getBody()));
if (claim != null && claim.getBody().containsKey("auth_time")) { if (claim != null && claim.getBody().containsKey("auth_time")) {
request.setInfo(JSON.toJSONString(claim.getBody())); request.setInfo(JSON.toJSONString(claim.getBody()));
...@@ -723,11 +725,11 @@ public class LoginServiceImpl implements LoginService { ...@@ -723,11 +725,11 @@ public class LoginServiceImpl implements LoginService {
} }
return false; return false;
} catch (ExpiredJwtException e) { } catch (ExpiredJwtException e) {
logger.info("苹果token过期" + e.getMessage()); logger.info("checkIdentifyToken-apple token expired" + e.getMessage());
throw new PicaException("苹果token过期", e.getMessage()); throw new PicaException("apple token expired Exception", e.getMessage());
} catch (Exception e) { } catch (Exception e) {
logger.info("苹果token非法" + e.getMessage()); logger.info("checkIdentifyToken-apple token illegal" + e.getMessage());
throw new PicaException("苹果token非法", e.getMessage()); throw new PicaException("apple token illegal Exception", e.getMessage());
} }
} }
......
...@@ -50,10 +50,10 @@ public class CryptoUtil { ...@@ -50,10 +50,10 @@ public class CryptoUtil {
} }
public static void main(String[] args) throws Exception { public static void main(String[] args) throws Exception {
Map<String, Object> param = new HashMap<>(10); Map<String, Object> param = new HashMap<>(6);
param.put("bizType", 1); param.put("identifyToken", "eyJraWQiOiI4NkQ4OEtmIiwiYWxnIjoiUlMyNTYifQ.eyJpc3MiOiJodHRwczovL2FwcGxlaWQuYXBwbGUuY29tIiwiYXVkIjoiY29tLnl1bnF1ZXlpLkRvY3RvciIsImV4cCI6MTU4MjcwMjg1NCwiaWF0IjoxNTgyNzAyMjU0LCJzdWIiOiIwMDExMzAuMmI4NzE0NjVmZDFmNDVmZmFmNWRjMjg3ZTQ4OWVlZjEuMDMxNSIsImNfaGFzaCI6InBpYjJScFAyc2U1eFJ4VlM1a0NRUlEiLCJlbWFpbCI6IjdnZ2E1cmo1dGNAcHJpdmF0ZXJlbGF5LmFwcGxlaWQuY29tIiwiZW1haWxfdmVyaWZpZWQiOiJ0cnVlIiwiaXNfcHJpdmF0ZV9lbWFpbCI6InRydWUiLCJhdXRoX3RpbWUiOjE1ODI3MDIyNTQsIm5vbmNlX3N1cHBvcnRlZCI6dHJ1ZX0.bLpPuyD_UJ2Pi7O2QSYSmUKy8wfssLdgOU3lztokJ-FVfTC7N_I183lyVW2C0BWRZURtGtUeqJRqEeKyMapPzgPd98PMOJn5wly_sTxSXKExR62gzcYmk0yY1rFYiiBsj9cbqvzUrqOlFvCi-h52MyimojK2XQx4DSvY69btjmdA0trjneH0HGmvvWGkU8jr1hv0ZkfD4WRAMA2AkeN8fbGHnnY6-_B0a6l_q_Id9eIWTqR2brDfrFGg7FZq_tc6hAC_Lrv6SvceD7UTk-MOXvBjzDrqqKVD-iP0pqyzyW1DjawG3AQuZRLIFN-qaYRzVMotdPeLxUqWEUDGriV9hg");
param.put("weChatLoginType", 1); //param.put("weChatLoginType", 1);
param.put("weChatCode", "071KMzjM1ge35a1oDekM1zptjM1KMzjO"); //param.put("weChatCode", "071KMzjM1ge35a1oDekM1zptjM1KMzjO");
aa(JSON.toJSONString(param)); aa(JSON.toJSONString(param));
} }
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册