Im trying to follow this example that is basically a bit of code to actually invalidate de login on angular.js.
I get "The method and() is undefined for the type HttpSecurity"
This is my part of my Code (line 89):
@EnableWebMvcSecurity
@Configuration
@Order(SecurityProperties.ACCESS_OVERRIDE_ORDER)
protected static class SecurityConfiguration extends WebSecurityConfigurerAdapter {
@Override
protected void configure(HttpSecurity http) throws Exception {
http.httpBasic()
.and().authorizeRequests()
.antMatchers("/login", "/error" , "/error.html")
.permitAll()
.anyRequest()
.fullyAuthenticated()
/*.permitAll().anyRequest().authenticated()*/
.and()
.logout()
.logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
.logoutSuccessUrl("/")
.permitAll()
.and()
.csrf().csrfTokenRepository(csrfTokenRepository())
.and()
.addFilterAfter(csrfHeaderFilter(), CsrfFilter.class)
.and() /* HERE IS WHERE I GET THE WARNING */
.sessionManagement()
.maximumSessions(1)
.expiredUrl("/expired")
.maxSessionsPreventsLogin(true)
.sessionRegistry(sessionRegistry());
}
...more code here
}
addFilterAfter()
already returns an instance ofHttpSecurity
so you can just callsessionManagement()
on it without callingand()
first.