BAEL-315 adding configuration for security on the config and discovery servers.

This commit is contained in:
Tim Schimandle
2016-10-03 13:01:01 -06:00
parent 66dfb6fd37
commit 798e72a121
11 changed files with 72 additions and 5 deletions
@@ -0,0 +1,28 @@
package com.baeldung.spring.cloud.integration.discovery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
@Configuration
@EnableWebSecurity
public class SecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception{
auth.inMemoryAuthentication()
.withUser("disc_configUser")
.password("configPassword")
.and()
.withUser("disc_discUser")
.password("discPassword")
.and()
.withUser("disc_gatewayUser")
.password("gatewayPassword")
.and()
.withUser("disc_resourceUser")
.password("resourcePassword");
}
}
@@ -1,2 +1,4 @@
spring.cloud.config.name=discovery
spring.cloud.config.uri=http://localhost:8081
spring.cloud.config.uri=http://localhost:8081
spring.cloud.config.username=config_discUser
spring.cloud.config.password=discPassword