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

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 后,就看到需要输入用户名和密码了

相关文章:

  • 2021-06-29
  • 2022-12-23
  • 2021-06-25
  • 2021-12-03
  • 2021-06-10
  • 2021-09-24
  • 2022-02-04
猜你喜欢
  • 2022-12-23
  • 2021-09-08
  • 2022-12-23
  • 2022-01-18
  • 2021-06-11
  • 2021-11-01
  • 2022-12-23
相关资源
相似解决方案