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

苹果登录常量提取

上级 88c13732
流水线 #22097 已失败 于阶段
in 0 second
......@@ -50,4 +50,9 @@ public class Constants {
/** 密码登录错误次数缓存时长*/
public static final int PWD_ERROR_NUM_SECONDS = 24 * 60 * 60;
/** 苹果后台获取公钥路径 */
public static final String APPLE_GET_PUBLIC_KEY_URL = "https://appleid.apple.com/auth/keys";
/** 苹果组织官网地址 */
public static final String APPLE_ISSUE_URL = "https://appleid.apple.com";
}
......@@ -659,7 +659,7 @@ public class LoginServiceImpl implements LoginService {
// 向苹果后台获取公钥参数
String appleResp = null;
try {
appleResp = HttpClientCloudUtils.getHttpExecute("https://appleid.apple.com/auth/keys");
appleResp = HttpClientCloudUtils.getHttpExecute(Constants.APPLE_GET_PUBLIC_KEY_URL);
//logger.info("checkIdentifyToken-appleResp:{}", appleResp);
} catch (Exception e) {
throw new PicaException("获取公钥失败", e.getMessage());
......@@ -707,7 +707,7 @@ public class LoginServiceImpl implements LoginService {
*/
private boolean verify(PublicKey key, String jwt, String audience, String subject) {
JwtParser jwtParser = Jwts.parser().setSigningKey(key);
jwtParser.requireIssuer("https://appleid.apple.com");
jwtParser.requireIssuer(Constants.APPLE_ISSUE_URL);
jwtParser.requireAudience(audience);
jwtParser.requireSubject(subject);
try {
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册