【发布时间】:2020-05-01 01:40:30
【问题描述】:
假设我在http://localhost:8080/ 上启动了服务器
如何配置以跳过 http://localhost:8080/aaaa 上的授权
【问题讨论】:
标签: spring spring-boot spring-security spring-security-oauth2
假设我在http://localhost:8080/ 上启动了服务器
如何配置以跳过 http://localhost:8080/aaaa 上的授权
【问题讨论】:
标签: spring spring-boot spring-security spring-security-oauth2
@EnableWebSecurity
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(final HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/aaaa").permitAll()
.anyRequest().authenticated();
}
}
【讨论】: