我正在尝试在 Spring 6.1.2 中设置 HttpSecurity 并且需要向其中添加 jwtEntrypoint 但我发现
protected void configure(HttpSecurity http) throws Exception {
http.cors().and().csrf().disable();
http.exceptionHandling().authenticationEntryPoint(jwtAuthenticationEntryPoint);has been removed
Run Code Online (Sandbox Code Playgroud)
我尝试了 http.exceptionHandling().authenticationEntryPoint(jwtAuthenticationEntryPoint); 正如一些答案中所见,但它仍然不起作用
我找到了解决方案。显然 spring 已经在 spring 6.1 中删除了 http.exceptionHandling() 所以为了解决我所做的问题
http.exceptionHandling((exception)-> exception.authenticationEntryPoint(jwtAuthenticationEntryPoint).accessDeniedPage("/error/accedd-denied"));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
4292 次 |
| 最近记录: |