美文网首页
Eureka 添加安全认证

Eureka 添加安全认证

作者: 吕志豪 | 来源:发表于2017-12-12 09:43 被阅读0次

一、添加spring-security支持

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

二、在配置文件中加入安全认证

# 安全认证的配置  
security:  
  basic:  
    enabled: true  
  user:  
    name: chhliu  # 用户名  
    password: chhliu123456   # 用户密码  
eureka:  
  client:  
    register-with-eureka: false  
    fetch-registry: false  
    service-url:  
      defaultZone: http://chhliu:chhliu123456@localhost:8761/eureka  # 安全的注册地址  

相关文章

网友评论

      本文标题:Eureka 添加安全认证

      本文链接:https://www.haomeiwen.com/subject/rssgixtx.html