Spring-cloud-config-client更新报错Full authentication is required to access this resource

发送post请求到client,更新配置文件http://localhost:8095/refresh,得到返回值

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

这是由于client服务开启了权限拦截,在配置文件bootrap.properties中增加一句忽略即可:

management.security.enabled=false

注意,pom文件加上Springcloud的健康监控的依赖包:

<dependency>
    <groupId>org.springframework.bootgroupId>
    <artifactId>spring-boot-starter-actuatorartifactId>
dependency>

你可能感兴趣的:(java,spring-boot)