升级 jhipster 后 JWT 签名无效
Invalid JWT signature after upgrading jhipster
我用 jhipster (4.14.5) 构建了两个微服务应用程序,今天我将它们都更新到了 5.1.0。使用 jhister-registry 最后 docker 图片 (4.0.0)
一切都按预期工作,但 API 带有 jwt 签名的调用不再工作。
MyRequestInterceptor
@Override
public void apply(RequestTemplate requestTemplate) {
String secret= Jwts.builder()
.setSubject("admin")
.claim("auth", AuthoritiesConstants.ADMIN)
.signWith(SignatureAlgorithm.HS512, properties.getSecurity().getAuthentication().getJwt().getSecret())
.compact();
requestTemplate.header(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer " + secret);
}
带有 JWT 的 jhipster 5.1.0 有什么新功能?我应该更改算法签名还是如何解决这个问题?
我用 jhipster (4.14.5) 构建了两个微服务应用程序,今天我将它们都更新到了 5.1.0。使用 jhister-registry 最后 docker 图片 (4.0.0)
一切都按预期工作,但 API 带有 jwt 签名的调用不再工作。
MyRequestInterceptor
@Override
public void apply(RequestTemplate requestTemplate) {
String secret= Jwts.builder()
.setSubject("admin")
.claim("auth", AuthoritiesConstants.ADMIN)
.signWith(SignatureAlgorithm.HS512, properties.getSecurity().getAuthentication().getJwt().getSecret())
.compact();
requestTemplate.header(JWTConfigurer.AUTHORIZATION_HEADER, "Bearer " + secret);
}
带有 JWT 的 jhipster 5.1.0 有什么新功能?我应该更改算法签名还是如何解决这个问题?