eureka注冊中心設置用戶名密碼


1.加入安全認證依賴

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

2.在application.properties加入認證的用戶名和密
security.user.name=你的用戶名
security.user.password=你的密碼

3.在訪問路徑上加入用戶名密碼
eureka.client.serviceUrl.defaultZone=http://${security.user.name}:${security.user.password}@127.0.0.1:${server.port}/eureka/

現在訪問需要輸入用戶名密碼,訪問路徑格式

   
   
  
  
          

http://your username:your password@127.0.0.1:8761/eureka/
“`


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM