Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http.authorizeRequests()
- .antMatchers(HttpMethod.OPTIONS,"/*").permitAll()
- .antMatchers("/actuator/*").permitAll()
- .antMatchers("/admin").hasRole("ADMIN")
- .antMatchers("/user").hasAnyRole("USER", "ADMIN")
- .antMatchers("/").permitAll()
- .and().formLogin()
- .and().csrf().disable()
- .logout()
- .invalidateHttpSession(true)
- .deleteCookies("JSESSIONID");
- http.cors().disable();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement