@Override
protected void configure(final HttpSecurity http) throws Exception {
http.authorizeRequests()
.anyRequest()
.authenticated()
.and()
.formLogin()
.defaultSuccessUrl("/index", true)
.and()
.logout()
.invalidateHttpSession(true);
}