我本地电脑部署BIZ业务是正常访问的,如图:

我把BIZ部署到正式机去,就一直报签名认证失败

可以检查一下系统时钟是否一致,我在一台电脑运行业务服务,其他电脑允许gateway等服务;
也有遇到这个问题;
测试流程:
@Getter
private static JwtProperties jwtProperties;
public static void setJwtProperties(JwtProperties properties) {
if (TokenUtil.jwtProperties == null) {
TokenUtil.jwtProperties = properties;
}
}
public static String getBase64Security() {
return Base64.getEncoder().encodeToString(getJwtProperties().getSignKey().getBytes(StandardCharsets.UTF_8));
}
public static Claims parseJWT(String jsonWebToken) {
try {
SecretKey secretKey = Keys.hmacShaKeyFor(Base64.getDecoder().decode(getBase64Security()));
return Jwts.parser()
.verifyWith(secretKey)
.build()
.parseSignedClaims(jsonWebToken)
.getPayload();
} catch (Exception ex) {
log.error("解析JWT异常!trace:{}", Exceptions.getStackTraceAsString(ex));
return null;
}
}对 parseJWT 的错误进行手动处理,可以看到以下日志
JwtUtil parseJWT error! e:io.jsonwebtoken.PrematureJwtException: JWT early by 1860 milliseconds before 2026-06-01T04:07:59.000Z. Current time: 2026-06-01T04:07:57.140Z. Allowed clock skew: 0 milliseconds.
扫一扫访问 Blade技术社区 移动端