Advertisement
Guest User

Untitled

a guest
Jan 14th, 2020
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.64 KB | None | 0 0
  1.     @Override
  2.     protected void configure(HttpSecurity http) throws Exception {
  3.         http.authorizeRequests()
  4.  
  5.                 .antMatchers(HttpMethod.OPTIONS,"/*").permitAll()
  6.                 .antMatchers("/actuator/*").permitAll()
  7.                 .antMatchers("/admin").hasRole("ADMIN")
  8.                 .antMatchers("/user").hasAnyRole("USER", "ADMIN")
  9.                 .antMatchers("/").permitAll()
  10.                 .and().formLogin()
  11.                 .and().csrf().disable()
  12.                 .logout()
  13.                 .invalidateHttpSession(true)
  14.                 .deleteCookies("JSESSIONID");
  15.  
  16.                 http.cors().disable();
  17.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement