【发布时间】:2017-09-26 03:57:28
【问题描述】:
我为我的项目使用 Spring Boot - 1.5.3.Release 版本。使用来自spring boot initializer site 的 Actuator 和 Dev-tools 插件 简单地测试了我的演示应用程序。 (因此我不再需要共享我的 POM,因为它是默认设置)。当我启动我的应用程序并尝试点击指标端点 URL 时,我得到这个 401 Unauthorized 状态(下图)。
以下选项试图绕过此异常
-
我在我的主类中排除了 SecurityAutoConfiguration。
@SpringBootApplication @EnableAutoConfiguration(exclude= {org.springframework.boot.autoconfigure.security.SecurityAutoConfiguration.class}) public class MainConfig {
但上面的选项不起作用。
- 当我降级我的 Spring-Boot - 1.4.6.RELEASE 版本时,我没有收到未经授权的异常。我的应用程序就像一个魅力:-)
问题
- 最新版本的 Spring-Boot(1.5.3.RELEASE 版本)是否进行了任何特定的安全增强?
- 如果有任何改进,请告知社区如何绕过此类异常?
- 我还注意到,当使用 Spring-boot (1.5.3.RELEASE) 时,它不会在启动时显示任何异常,即使我的 IDE 构建路径中有多个主程序。这也是spring-boot(1.5.3.RELEASE)版本的增强吗?
请澄清。
【问题讨论】:
-
你真的读过the docs吗?
标签: maven spring-boot spring-security spring-boot-actuator spring-boot-maven-plugin