如何解决Springboot执行器刷新和总线刷新总是返回401未经授权
我从Jenkins撞到bus-refresh
端点,我希望该端点不安全。
下面是我的application.yml
management:
endpoints:
web:
exposure:
include: health,refresh,bus-refresh
base-path: /
health:
ldap:
enabled: false
下面是我在spring-boot中的http配置
http
.anonymous()
.and()
.authorizeRequests()
.antMatchers("/swagger-ui.html","/error","/swagger-resources/**","/webjars/**","/v2/api-docs","/test/**","/api/v1/calculate/**").permitAll()
.antMatchers("/health","/refresh/","/bus-refresh/").permitAll()
.anyRequest().authenticated()
.and()
.oauth2ResourceServer()
现在,当我按下curl --request GET http://localhost:8080/health
时,我将得到如下正确的响应
{"status":"UP"}
但是当我按下curl --request POST http://localhost:8080/bus-refresh
或curl --request POST http://localhost:8080/refresh
我得到403和401
{"timestamp":"2020-08-26T10:46:26.370+00:00","status":403,"error":"Forbidden","message":"","path":"/bus-refresh"}
我已尽力而为,但仍然无法使refresh
和bus-refresh
脱离安全性。需要帮助
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。