Skip to content

Instantly share code, notes, and snippets.

@sedkis
Created March 18, 2019 20:12
Show Gist options
  • Save sedkis/6392c853c0f5f1b4865056c6fb2e29bb to your computer and use it in GitHub Desktop.
Save sedkis/6392c853c0f5f1b4865056c6fb2e29bb to your computer and use it in GitHub Desktop.
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
private String apiUser;
private String apiPassword;
@Autowired
public WebSecurityConfig(
@Value("${web.security.api.user}") String apiUser, // stored in plain text in application.properties
@Value("${web.security.api.password}") String apiPassword) // no reference in plaintext
{
this.apiUser = apiUser;
this.apiPassword = apiPassword;
}
.....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment