From d43b1a3e6bb577489829f2088c8acaa3854aad88 Mon Sep 17 00:00:00 2001 From: Rohan Sircar Date: Sat, 30 May 2020 14:58:09 +0530 Subject: [PATCH] Cleaned up security config file --- .../ros/chatto/WebSecurityConfiguration.java | 50 ------------------- 1 file changed, 50 deletions(-) diff --git a/src/main/java/org/ros/chatto/WebSecurityConfiguration.java b/src/main/java/org/ros/chatto/WebSecurityConfiguration.java index 109a7d0..202fd51 100644 --- a/src/main/java/org/ros/chatto/WebSecurityConfiguration.java +++ b/src/main/java/org/ros/chatto/WebSecurityConfiguration.java @@ -76,17 +76,6 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { // .hasAnyRole("USER", "ADMIN", "SUPER_USER") .authenticated() .and().httpBasic().authenticationEntryPoint(authenticationEntryPoint) -// .and() -// .logout().invalidateHttpSession(true).clearAuthentication(true) -// .logoutRequestMatcher(new AntPathRequestMatcher("/api/perform_logout")) -// .logoutSuccessUrl("/").permitAll() -// .and() -// .formLogin() -// .loginProcessingUrl("/api/perform_login").permitAll() -// .and() -// .formLogin() -// .and() -// .logout(); ; http.addFilterBefore(tokenFilter, BasicAuthenticationFilter.class); @@ -99,15 +88,6 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { } -// @Override -// protected void configure(AuthenticationManagerBuilder auth) throws Exception { -// auth.eraseCredentials(false); -// } -// -// public class SecurityWebApplicationInitializer extends AbstractSecurityWebApplicationInitializer { -// -// } - } @Configuration @@ -141,39 +121,9 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter { .formLogin().loginPage("/login").permitAll().loginProcessingUrl("/perform_login") .successHandler(loginSuccessHandler).and().logout() .logoutSuccessHandler(logoutSuccessHandler) -// .failureUrl("/?login_error") -// .and() -// .logout().invalidateHttpSession(true) -// .clearAuthentication(true) -// .logoutRequestMatcher(new AntPathRequestMatcher("/perform_logout")) -// .logoutSuccessUrl("/").permitAll() -// .and().httpBasic(); -// .and().cors() -// .and().csrf().disable(); ; -// httpSecurity -// .csrf().disable() -// .authorizeRequests().antMatchers("login").permitAll() -// .anyRequest().authenticated() -// .and() -// .formLogin() -// .loginPage("/login").permitAll() -// .and() -// .logout().invalidateHttpSession(true) -// .clearAuthentication(true) -// .logoutRequestMatcher(new AntPathRequestMatcher("/logout")) -// .logoutSuccessUrl("/").permitAll(); } -// @Override -// protected void configure(AuthenticationManagerBuilder auth) throws Exception { -// auth.eraseCredentials(false); // } } - -// @Override -// protected void configure(AuthenticationManagerBuilder auth) throws Exception { -// auth.eraseCredentials(false); -// } - }