SpringCloud请求/refresh时报错Full authentication is required to access this resource

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

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

是因为 spring-boot-starter-actuator 需要验证才能访问,因此只要关闭验证即可,如下:
1、在peroperites里面要加入management.security.enabled=false 来保证调用 /bus/refresh的时候不需要验证。
2、或者 yml文件中添加:
management:
security:
enabled: false #是否开启actuator安全认证

你可能感兴趣的:(SpringCloud请求/refresh时报错Full authentication is required to access this resource)