在Spring Boot管理员中未经授权 [英] Unauthorized in spring boot admin

查看:131
本文介绍了在Spring Boot管理员中未经授权的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想控制Eureka服务器中运行的微服务.我为此使用spring-boot-admin,但在访问有关Trace,Log等信息时出现错误...

I wanted to control the microservices that are running in the Eureka server. I used spring-boot-admin for this, but I am getting the error on accessing the information about the Trace,Log etc...

我得到的错误是

错误:{时间戳":1489052472862,状态":401,错误":未经授权",消息":需要完全身份验证才能访问此资源.",路径":"/度量" }

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

我的依赖项是

<dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-eureka</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>spring-boot-admin-server</artifactId>
        <version>1.4.3</version>
    </dependency>
    <dependency>
        <groupId>de.codecentric</groupId>
        <artifactId>spring-boot-admin-server-ui</artifactId>
        <version>1.4.3</version>
    </dependency>

,以下所有属性均无效

endpoints.info.id=information
endpoints.info.sensitive=false
endpoints.info.enabled=true
information.app.name=Actuator Example
information.app.description=Actuator Example
information.app.version=1.0.0

并且所有端点都发生了同样的事情,例如映射,env,并且所有人都接受健康状况

and the same thing is happening with all the end points like mappings, env and all accept health

推荐答案

application.properties中设置management.security.enabled=false将禁用端点上的安全性.

Setting management.security.enabled=false in the application.properties will disable the security on the endpoints.

这篇关于在Spring Boot管理员中未经授权的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆