Hi!
We are upgrading from Vaadin 14 to Vaadin 24.
In our SecurityConfiguration we used to turn off the Spring boot csrf but I read that we should not need this after Vaadin 21.
The code below is working fine until I remove http.csrf(AbstractHttpConfigurer::disable)
If I remove it and try to logout I get:
Could not navigate to 'doLogout'
@EnableWebSecurity
@Configuration
@Profile(value = {"local-development-security"})
public class LocalDevelopmentSecurityConfiguration extends VaadinWebSecurity {
@Autowired
private Environment env;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.authorizeHttpRequests(requests ->
requests.requestMatchers(UIUtils::isFrameworkInternalRequest).permitAll()
.requestMatchers("/frontend/**", "/frontend-es5/**", "/frontend-es6/**", "/VAADIN/**",
"/login_error*", "/logout", "/timeout", "/diagnostics/**",
"/test-authenticate*", "/offline-stub.html", "/sw-runtime-resources-precache.js")
.permitAll()
)
.formLogin(login -> login.loginPage("/" + SecurityUtils.getLoginPage(env)).permitAll())
.logout(logout -> logout.logoutUrl("/doLogout").logoutSuccessUrl("/logout"));
super.configure(http);
http.csrf(AbstractHttpConfigurer::disable); // use Vaadin's CSRF protection instead.
SecurityUtils.disableViewAccessChecker(getViewAccessChecker());
}
}