博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
SpringSecurity配置过滤Swagger(Boostrap-ui)文档路径
阅读量:3944 次
发布时间:2019-05-24

本文共 650 字,大约阅读时间需要 2 分钟。

权限认证框架会拦截swagger文档api,无法访问。

swagger访问文档路径:http://ip:port/swagger-ui.html
swagger-boostrap-ui访问文档路径:http://ip:port/doc.html
SpringSecurity配置忽略以上路径和swagger静态资源代码如下:
WebSecurityConfiguration.java文件

@Override    public void configure(WebSecurity web) throws Exception {
web.ignoring() .antMatchers(AUTH_WHITELIST); // 忽略swagger ui静态资源 } // -- swagger ui忽略 private static final String[] AUTH_WHITELIST = {
// -- swagger ui "/swagger-resources/**", "/swagger-ui.html", "/v2/api-docs", "/webjars/**", // swagger-boostrap-ui "/doc.html" };

转载地址:http://aviwi.baihongyu.com/

你可能感兴趣的文章
Linux下,write/read,recv/send, recvfrom/sendto的区别
查看>>
ubuntu下 rc.local的脚本不运行
查看>>
Linux下简单Makefile文件的编写
查看>>
linux下配置JDK JAVA环境
查看>>
解决Ubuntu 14.04 grub选择启动项10秒等待时间
查看>>
Python函数操作集锦之字符串测试、判断函数
查看>>
Python字符串操作集锦之字符串映射表
查看>>
Python字符串操作集锦之字符串编码解码函数
查看>>
Python字符串类型转换函数
查看>>
Python有用的命令
查看>>
Python条件语句
查看>>
Python eval()函数
查看>>
Linux rz和sz命令详解
查看>>
Python 集合set
查看>>
Codeforces Round #400 (Div. 1 + Div. 2, combined)D - The Door Problem(2-sat)
查看>>
IDEA中Struts2文件上传时404错误The origin server did not find a current representation for the target resour
查看>>
Perl/Tk 变量追踪及类线程实现
查看>>
1.嵌入式开发环境搭建--虚拟机安装(unbutu)系统
查看>>
2.嵌入式开发环境搭建--(unbutu)系统
查看>>
Linux USB驱动分析之USB2.0协议分析
查看>>