英文:
Updating depreacted jwt-function with custom JwtAuthenticationConverter
问题
我有这行代码:
http.oauth2ResourceServer(server -> server.jwt().jwtAuthenticationConverter(jwtAuthenticationConverter()));
用以下代码替代:
@Bean
public JwtAuthenticationConverter jwtAuthenticationConverter() {
...
}
jwt()已被弃用,我尝试使用<code>jwt(JwtConfigurer)</code>。 这个怎么用?如何将我的AuthenticationConverter注册到该函数中?
谢谢!
英文:
I have this line of code:
http.oauth2ResourceServer(server -> server.jwt().jwtAuthenticationConverter(jwtAuthenticationConverter()));
with
@Bean
public JwtAuthenticationConverter jwtAuthenticationConverter() {
...
}
jwt() is deprecated and I'm tried to use <code>jwt(JwtConfigurer)</code>. How does that work? How to register my AuthenticationConverter with that function?
Thanks!
答案1
得分: 4
Sure, here's the translated code snippet:
http
.oauth2ResourceServer(configurer ->
configurer.jwt(
jwtConfigurer -> jwtConfigurer.jwtAuthenticationConverter(jwtAuthenticationConverter())
)
)
英文:
http
.oauth2ResourceServer(configurer ->
configurer.jwt(
jwtConfigurer -> jwtConfigurer.jwtAuthenticationConverter(jwtAuthenticationConverter())
)
)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论