Reputation: 5906
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?
Upvotes: 0
Views: 1309
Reputation: 58094
You need to set the config server URI in bootstrap.yml (or .properties) because it is needed in the bootstrap phase.
Upvotes: 2
Reputation: 1
Did you configure custom spring security configuration? url and credentials to access config server needs to be setup in bootstrap phase
additional you can change security using WebSecurityConfigurer
@Configuration
@EnableWebMvcSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
Upvotes: 0