Cleaned up security config file

This commit is contained in:
Rohan Sircar 2020-05-30 14:58:09 +05:30
parent 26f898c37c
commit d43b1a3e6b

View File

@ -76,17 +76,6 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
// .hasAnyRole("USER", "ADMIN", "SUPER_USER") // .hasAnyRole("USER", "ADMIN", "SUPER_USER")
.authenticated() .authenticated()
.and().httpBasic().authenticationEntryPoint(authenticationEntryPoint) .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); 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 @Configuration
@ -141,39 +121,9 @@ public class WebSecurityConfiguration extends WebSecurityConfigurerAdapter {
.formLogin().loginPage("/login").permitAll().loginProcessingUrl("/perform_login") .formLogin().loginPage("/login").permitAll().loginProcessingUrl("/perform_login")
.successHandler(loginSuccessHandler).and().logout() .successHandler(loginSuccessHandler).and().logout()
.logoutSuccessHandler(logoutSuccessHandler) .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);
// }
} }