spring - 如何在 Spring OAuth2 中配置未经授权的端点
问题描述
假设我在http://localhost:8080/
上启动了服务器,我该
如何配置以跳过http://localhost:8080/aaaa上的授权
解决方案
@EnableWebSecurity
@Configuration
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
public void configure(final HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/aaaa").permitAll()
.anyRequest().authenticated();
}
}
推荐阅读
- graphql - AWS Appsync 订阅可靠交付?
- r - 在 gghighlight_line R 中放置标签
- c++ - 如何加快编译多个模板类型定义?(macOS,Clang)
- django - Django 1.11 禁止直接分配到多对多集合的前端
- delay - RxJava2 延迟订阅现在做
- javascript - Onclick 使效果在 javascript 中工作
- java - 将java中的正则表达式转换为golang。纠正我
- javascript - 试图用对象构建矩阵
- join - Log Analytics - 是否可以将行合并为同一列 ID 上的单行
- c - 如何将枚举变量分配给数组索引的指针