Skip to content

Instantly share code, notes, and snippets.

@skryvets
Created March 14, 2019 16:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save skryvets/3f2758c2262a5cab175de464a9c26323 to your computer and use it in GitHub Desktop.
Save skryvets/3f2758c2262a5cab175de464a9c26323 to your computer and use it in GitHub Desktop.
@Configuration
@EnableWebSecurity
public class WebSecurity extends WebSecurityConfigurerAdapter {
public WebSecurity() {}
@Override
protected void configure(HttpSecurity http) throws Exception {
http.cors().and().csrf().disable().authorizeRequests()
.antMatchers("/**").permitAll()
// this disables session creation on Spring Security
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment