您的位置:首页 > 编程语言 > Java开发

spring-cloud-netflix eureka服务添加基本用户验证

2016-08-15 18:59 597 查看
来自于stackoverflow问题的整理

只需要在工程中依赖 org.springframework.boot:spring-boot-starter-security

在bootstrap.yml中添加以下配置即可

security:
basic:
enabled: true
user:
name: ctp_config
password: ctp_config


更为详细的描述

在Eureka server中放置如下配置
security:
basic:
enabled: true
user:
name: user # login username
password: password


在服务配置中增加一下配置
eureka:
client:
registerWithEureka: true
fetchRegistry: true
serviceUrl:
defaultZone: http://user:password@localhost:8761/eureka/
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐