jwt - Invalid JWT signature after upgrading jhipster
问题描述
I builded two microservices applications with jhipster (4.14.5), today i updated the both to 5.1.0. With jhister-registry last docker image (4.0.0)
All work as expected but the API Calls with jwt signature doesnt work anymore.
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);
}
What is new in jhipster 5.1.0 with JWT? should i change the algorithm signature or how to fix this?
解决方案
推荐阅读
- javascript - 我的 javascript 代码不适用于工作 php 的结果
- android - RecyclerView 项目未按预期显示
- ios - 如何在自定义表格视图单元格填充和圆角内给出标签
- java - 我们可以在类中初始化 WebDriverWait
- node.js - 导入 uuid 时无法使用导入语法错误
- python - 我遇到了 subprocess.call() python 的问题
- angular - 将多个类应用于 html 标签的哪种方式具有最佳性能?角 2
- flutter - 如何在 Flutter 中使用正则表达式突出显示 TextFormField 小部件内的文本
- reactjs - 如何传递参数以做出反应?
- ssl - 客户端 SSL 证书是否需要更新?