Skip to content

Instantly share code, notes, and snippets.

@dsimonow
Created July 1, 2020 14:43
Show Gist options
  • Save dsimonow/ace5ce36d44141fd709eead9caddac8e to your computer and use it in GitHub Desktop.
Save dsimonow/ace5ce36d44141fd709eead9caddac8e to your computer and use it in GitHub Desktop.
@Configuration
@EnableWebSecurity
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http
.authorizeRequests()
.antMatchers("/", "/aviav","/h2").permitAll()
.anyRequest().authenticated()
.and()
.formLogin()
.loginPage("/login")
.permitAll()
.and()
.logout()
.permitAll();
http.csrf().disable();
http.headers().frameOptions().disable();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment