【老王公众号】

Eureka开启登录认证

Eureka服务端配置

一、Eureka的pom.xml 引入spring-boot-starter-security坐标

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-security</artifactId>
        </dependency>

二、Eureka的application.properties 新增用户名密码配置

security.user.password=root
security.user.name=root

三、启动Eureka,根据提示,输出用户名密码,成功进入Eureka

Eureka客户端配置

一、修改Config的application.properties

eureka.client.serviceUrl.defaultZone=http://root:root@localhost:7070/eureka/

二、启动Config。

 

posted @ 2018-09-19 12:01  CTO老王  阅读(2565)  评论(1编辑  收藏  举报