spring-boot-actuator报错Full authentication is required to access this resource


解决办法【设置端点访问 】:

1, 关闭验证

management.security.enabled=false

 

2,开启HTTP basic认证 

-  添加依赖

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>

- application.properties 添加用户名和密码

security.user.name=admin
security.user.password=123456
management.security.enabled=true
management.security.role=ADMIN

访问URL http://localhost:8080/env 后,就看到需要输入用户名和密码了


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM