Advertisement
Guest User

Untitled

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