Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. @Configuration
  2. public class SecurityConfig extends WebSecurityConfigurerAdapter {
  3.  
  4. @Override
  5. protected void configure(HttpSecurity http) throws Exception {
  6. http
  7. .httpBasic()
  8. .and()
  9. .authorizeRequests().antMatchers("/secret/**").authenticated()
  10. .and()
  11. .authorizeRequests().antMatchers("/**").permitAll();
  12. }
  13.  
  14. @Override
  15. public void configure(WebSecurity web) throws Exception {
  16. web.ignoring().antMatchers("/resources/**");
  17. }
  18.  
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement