当前位置:网站首页>It becomes obsolete when you use it ~websecurityconfigureradapter

It becomes obsolete when you use it ~websecurityconfigureradapter

2022-06-09 03:34:00 CodeMartain

In writing today Spring( The latest version ) frame , Control front-end login , The configuration class inherits WebSecurityConfigurerAdapter when , The report says it's time , It was easy to use a few months ago , When you say it, it's out of date !

Technology is changing so fast !

Now that it's out of date , What should I write after that ? For ordinary white programmers, although we can't write the code at the bottom of those big guys , We also have to make sure we can use it !

So , Online search API, Write code -

Change means no inheritance WebSecurityConfigurerAdapter, It is
Injected into a filter chain Bean, This filter chain is used to process user login requests ;

The return value of the filter chain is –SecurityFilterChain( Interface ) The entity class

 Insert picture description here
It doesn't look much different from before


@Configuration
public class MySecurityConfig { 
    
@Autowired
    MyAccessDenyHandler myAccessDenyHandler;
    @Bean
原网站

版权声明
本文为[CodeMartain]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/159/202206080952284730.html