Spring Security 使用自定义JwtAuthenticationConverter更新解压缩的jwt-function

5n0oy7gb  于 2023-08-05  发布在  Spring
关注(0)|答案(1)|浏览(118)

我有这样一行代码:

http.oauth2ResourceServer(server -> server.jwt().jwtAuthenticationConverter(jwtAuthenticationConverter()));

字符串

@Bean
public JwtAuthenticationConverter jwtAuthenticationConverter() {
...
}


jwt()已被弃用,我尝试使用jwt(JwtConfigurer)。这是怎么回事?如何使用该函数注册我的AuthenticationConverter?
谢谢你,谢谢

kxe2p93d

kxe2p93d1#

https://docs.spring.io/spring-security/reference/reactive/oauth2/resource-server/jwt.html#webflux-oauth2resourceserver-jwt-authorization-extraction

http
     .oauth2ResourceServer(configurer ->
            configurer.jwt(
                jwtConfigurer -> jwtConfigurer.jwtAuthenticationConverter(jwtAuthenticationConverter())
            )
     )

字符串

相关问题