TA的每日心情 | 无聊 昨天 09:47 |
---|
签到天数: 528 天 连续签到: 1 天 [LV.9]测试副司令
|
1测试积点
我知道从security升级到5.2.X版本之后配置 jwtAuthenticationConverter这个可以解决,但是我现在的security版本为5.1.8,没有JwtGrantedAuthoritiesConverter这个类,而且我这个整体还不能升级,要怎么配置呢
5.2以上版本这样配置,但是我现在这个版本要怎么弄呢,cloud版本为Greenwitch.SR6
- @Bean
- public Converter<Jwt, ? extends Mono<? extends AbstractAuthenticationToken>> jwtAuthenticationConverter() {
- JwtGrantedAuthoritiesConverter jwtGrantedAuthoritiesConverter = new JwtGrantedAuthoritiesConverter();
- jwtGrantedAuthoritiesConverter.setAuthorityPrefix(AuthConstants.AUTHORITY_PREFIX);
- jwtGrantedAuthoritiesConverter.setAuthoritiesClaimName(AuthConstants.JWT_AUTHORITIES_KEY);
- JwtAuthenticationConverter jwtAuthenticationConverter = new JwtAuthenticationConverter();
- jwtAuthenticationConverter.setJwtGrantedAuthoritiesConverter(jwtGrantedAuthoritiesConverter);
- return new ReactiveJwtAuthenticationConverterAdapter(jwtAuthenticationConverter);
- }
复制代码
|
|