Spring Cloud配置/bus/refresh错误 Full authentication is required to access this resource.

在刷新配置中心的时候,如:http://localhost:8030/bus/refresh

会遇到一下错误:

{
   "timestamp": 1533892993040,
   "status": 401,
   "error": "Unauthorized",
   "message": "Full authentication is required to access this resource.",
   "path": "/bus/refresh"
}

提示没有权限,这个是因为 spring-boot-starter-actuator 需要验证,因此只要验证即可,如下:

在peroperites里面要加入management.security.enabled=false 来保证调用 /bus/refresh的时候不需要验证。
或者  yml文件中添加:
 

management:
  security:
    enabled: false #是否开启actuator安全认证
 

再次post访问刷新即可正常!

猜你喜欢

转载自blog.csdn.net/yuyecsdn/article/details/89944582