Skip to content

Instantly share code, notes, and snippets.

@geapi
Last active November 18, 2016 18:12
Show Gist options
  • Save geapi/19d8d3fb0f1faa036e9f045e2f8e3209 to your computer and use it in GitHub Desktop.
Save geapi/19d8d3fb0f1faa036e9f045e2f8e3209 to your computer and use it in GitHub Desktop.
example SecurityConfig for Spring wit basic auth (locally)
// imports
@Configuration
@Profile("development")
public class DevelopmentSecurityConfig extends WebSecurityConfigurerAdapter {
@Autowired
public void configureGlobal(AuthenticationManagerBuilder auth) throws Exception {
auth
.inMemoryAuthentication()
.withUser("user").password("password").roles("USER");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment