我正在使用spring cloud config server 1.3.1configuration一个spring boot 1.5.4客户端。 客户端和服务器工作没有任何身份validation。 但是,我试图configurationHTTP基本身份validation不起作用。 当我通过浏览器访问Spring云configuration服务器URL时,即使没有身份validation,它仍然可以访问。 我可能会错过一些基本的东西。
我的客户端bootstrap.properties文件是
spring.application.name=service1 spring.cloud.config.uri=https://config.example.com spring.cloud.config.username=username spring.cloud.config.password=xxxx spring.profiles.active=profile1,profile2 management.security.enabled=true
而我的云configuration服务器application.properties看起来像 –
server.port=443 spring.application.name=spring-config spring.cloud.config.server.git.uri=https://gitlab.com/services/service1.git spring.cloud.config.server.git.username=serviceuser spring.cloud.config.server.git.password=servicepass spring.cloud.config.server.git.clone-on-start=true security.user.name=username security.user.password=xxxx spring.cloud.config.server.health.enabled=false spring.cloud.config.server.bootstrap=true spring.cloud.config.server.prefix=/config
当我访问` https://config.example.com/service1/label我没有得到任何forms的身份validation,但我看到我在JSONconfigurationservice1-label.properties
任何帮助表示赞赏!
要使用默认的Spring Bootconfiguration的HTTP Basic安全性,只需在类path中包含Spring Security(例如通过spring-boot-starter-security)即可。