我使用带有执行器的 spring boot 并添加了安全配置:
management.port=8088
management.address=127.0.0.1
management.security.enabled=true
security.user.name=admin
security.user.password=secret
management.security.role=SUPERUSER
curl -u admin:secret http://127.0.0.1:8088/metrics
可以,但使用 Chrome ( http://127.0.0.1:8088/metrics ):{"timestamp":1506692938036,"status":401,"error":"Unauthorized","message":"Full authentication is required to access this resource.","path":"/metrics"}
如何在 url 或 headers 中使用登录名/密码?
编辑 1
我尝试@Lachezar Balev 解决方案(授权:基本 YWRtaW46c2VjcmV0 + admin:secret@ in url)但是是 KO