SHARE
TWEET

Untitled

a guest Jun 16th, 2019 58 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top