http://www.daohangren.cn
第一步:在eureka server中引入依赖
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-security</artifactId>
</dependency>
第二步:在eureka server配置文件中加入配置
security:
basic:
enabled: true
user:
name: name
password: password
第三步:在client端修改defaultZone地址
eureka:
instance:
instanceId: service
client:
# 表示是否注册自身到eureka服务器
register-with-eureka: false
# 是否从eureka上获取注册信息
fetch-registry: false
serviceUrl:
defaultZone: http://${security.user.name}:${security.user.password}@${server.address}:${server.port}/eurek
最后
以上就是文静口红最近收集整理的关于SpringCloud Eureka 安全认证http://www.daohangren.cn 的全部内容,更多相关SpringCloud内容请搜索靠谱客的其他文章。
发表评论 取消回复