daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Apr 25th, 2018 45 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. @Configuration
  2. @EnableWebSecurity
  3. public class WebSecurityConfig extends WebSecurityConfigurerAdapter {
  4. @Override
  5. protected void configure(HttpSecurity http) throws Exception {
  6.  
  7.     http.authorizeRequests()
  8.         .antMatchers("/bower_components/**", "/*.js",
  9.                 "/*.jsx", "/main.css").permitAll()
  10.         .antMatchers("/login").permitAll()
  11.         .antMatchers("/handle/**").permitAll()
  12.         .antMatchers("/build/*").permitAll()
  13.         .antMatchers("/register").permitAll()
  14.         .antMatchers("/css/**").permitAll()
  15.         .antMatchers("/js/**").permitAll()
  16.         .anyRequest().authenticated()
  17.         .and()
  18.     .formLogin()
  19.         .loginPage("/loginn")
  20.         .defaultSuccessUrl("/", true)
  21.         .permitAll()
  22.         .and()
  23.     .logout()
  24.         .logoutSuccessUrl("/")
  25.     .and()
  26.     .csrf()  
  27.     .disable();
  28. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top