Search code examples
vaadinvaadin-flowvaadin23

No qualifying bean of type 'com.vaadin.flow.spring.security.VaadinDefaultRequestCache' available


Just upgraded a small vaadin application vom 22 to 23 and now I have a problem that the system throws an error on startup that my securityConfig requires the com.vaadin.flow.spring.security.VaadinDefaultRequestCache bean which is not available.

I already checked if there were any changes done from 22 to 23 in vaadon secrity, but did not find anything.

I have a quiet simple SecurityConfig for the application:

@EnableWebSecurity
@Configuration
public class SecurityConfig extends VaadinWebSecurityConfigurerAdapter {
    // Our custom authentication provider
    @Autowired
    private AppCustomAuthenticationProvider authProvider;

    @Override
    protected void configure(HttpSecurity http) throws Exception {

        http.rememberMe().alwaysRemember(false);

        // Define public resources, must be before super.configure()
        http.authorizeRequests().antMatchers("/VAADIN/**").permitAll();
        http.authorizeRequests().antMatchers("/services/**").permitAll();

        // Vaadin public views/resources
        http.authorizeRequests().antMatchers("/newstool/unregister/**").permitAll();

        super.configure(http);

        // This is important to register your login view to the
        // view access checker mechanism:
        setLoginView(http, LoginView.class);
    }

    /**
     * Configuration of the custom authentication provider
     */
    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.authenticationProvider(authProvider);
    }


    /**
     * Exclude Vaadin-framework communication and static assets from Spring Security
     */
    @Override
    public void configure(WebSecurity web) throws Exception {
        // Configure your static resources with public access here:
        web.ignoring().antMatchers(
                "/images/**"
        );

        // Delegating the ignoring configuration for Vaadin's
        // related static resources to the super class:
        super.configure(web);
    }
}

Has someone faced a similiar problem when migrating from 22 to 23?

Florian


Solution

  • When using the Upgrade Guide Generator there is no information that at least 2.7. is required instead of 2.6.6 to uprade from Vaadin 22 to 23.3.6.

    Thank you for your help! Florian