spring-boot-actuator報錯Full authentication is required to access this resource

解決辦法【設置端點訪問 】:spring

1, 關閉驗證app

management.security.enabled=false

 

2,開啓HTTP basic認證 spring-boot

-  添加依賴spa

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

- application.properties 添加用戶名和密碼code

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

訪問URL http://localhost:8080/env 後,就看到須要輸入用戶名和密碼了blog

相關文章
相關標籤/搜索