Guest User

Untitled

a guest
Apr 25th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  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. }
Add Comment
Please, Sign In to add comment