【发布时间】:2018-05-17 18:44:06
【问题描述】:
我尝试在我的网络应用程序中实现重启功能。
我添加了以下依赖项:
compile("org.springframework.boot:spring-boot-starter-actuator")
compile("org.springframework.cloud:spring-cloud-starter:1.2.4.RELEASE")
在启动日志中我发现 post /restart 已注册。
我决定请求这个网址:
但结果是失败。我知道这个 url 应该受到保护,但我有自定义授权/身份验证机制,我无权更改它。
有没有办法禁用对该网址的保护?一种更好的方法 - 拥有可以在我的控制器中注入并调用的服务。弹簧里面有什么东西可以解决我的问题吗?
【问题讨论】:
-
在你的 WebConfig 中禁用它...docs.spring.io/spring-security/site/docs/current/reference/html/…
-
@Herr Derb,实际上我在类路径中没有 spring 安全性
-
那么安全性从何而来???
-
org.springframework.boot.actuate.endpoint.mvc.MvcEndpointSecurityInterceptor#isUserAllowedAccess
-
@Herr Derb,我使用 cuetom 安全机制。此机制与spring无关
标签: java spring-boot spring-security spring-cloud application-restart