【问题标题】:how to configure unauthorized endpoint in Spring OAuth2 [closed]如何在 Spring OAuth2 中配置未经授权的端点 [关闭]
【发布时间】:2020-05-01 01:40:30
【问题描述】:

假设我在http://localhost:8080/ 上启动了服务器
如何配置以跳过 http://localhost:8080/aaaa 上的授权

【问题讨论】:

    标签: spring spring-boot spring-security spring-security-oauth2


    【解决方案1】:
    @EnableWebSecurity
    @Configuration
    public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
    
        @Override
        public void configure(final HttpSecurity http) throws Exception {
            http
                .authorizeRequests()
                .antMatchers("/aaaa").permitAll()
                .anyRequest().authenticated();
        }
    }
    

    【讨论】:

      猜你喜欢
      • 2018-11-13
      • 1970-01-01
      • 2016-10-28
      • 1970-01-01
      • 2019-08-09
      • 2018-09-26
      • 2019-06-03
      • 2017-11-30
      • 1970-01-01
      相关资源
      最近更新 更多