在 Spring Security 5.7.0-M2 中,弃用了 WebSecurityConfigurerAdapter,Spring 鼓励用户转向基于组件的安全配置。 配置 HttpSecurity 在 Spring Security 5.4 中,Spring 引入了通过创建 SecurityFilterChain bean 来配置 HttpSecurity 的能力。 以下是使用 WebSecurityConfigurerAdapter 的示例配置,该配置使用 HTTP Basic 保护所有站点:(不推荐使用) @Configuration public class SecurityConfiguration extends WebSecurityConfigurerAdapter { @Override protected void configure(HttpSecurity http) throws Exception { http .authorizeHttpRequests((authz) -> authz .anyRequest().authenticated()...
Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Get in touch with return
Contact return, search articles and posts on X, monitor coverage, and track replies from one place.
Learn more about Muck Rack