I want to use spring cloud config server security :
I find the example in : https://github.com/spring-cloud-samples/config-repo/blob/master/application.yml
profile:
cloud:
config:
uri: ${vcap.services.${PREFIX:}configserver.credentials.uri:http://user:password@${PREFIX:}configserver.${application.domain:cfapps.io}}
But: i can not understand : whats the some words meaning ?
e.g.
And , if i use docker instead of cloud profile , like this :
docker
config:
uri: http://${CONFIGSERVER_1_PORT_8888_TCP_ADDR:localhost}:8888
client:
serviceUrl:
defaultZone: http://${EUREKA_1_PORT_8761_TCP_ADDR:localhost}:8761/eureka/
when i try this :
in coifing-server application.yml :
security:
user:
password: 1
in client-server application.yml
spring:
cloud:
config:
uri: http://user:1@localhost:8888
The client-server console has errors :
c.c.c.ConfigServicePropertySourceLocator : Fetching config from server at: http://localhost:8888
c.c.c.ConfigServicePropertySourceLocator : Could not locate PropertySource: label not found
Whole Code is in : https://github.com/keryhu/coud-config-security
How do i implement security config ?
can help me?
答案 0 :(得分:2)
您需要在bootstrap.yml(或.properties)中设置配置服务器URI,因为在引导阶段需要它。
答案 1 :(得分:0)
您是否配置了自定义弹簧安全配置? 需要在引导阶段
中设置访问配置服务器的URL和凭据您可以使用WebSecurityConfigurer更改安全性
@Configuration
@EnableWebMvcSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {