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

    xiaoxiao2025-12-06  3

    来自于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/

    转载请注明原文地址: https://ju.6miu.com/read-1304674.html
    最新回复(0)