【发布时间】:2021-06-29 12:40:33
【问题描述】:
我无法使用 UploadComponent 上传文件。我有一个 Spring 应用程序,使用启用了 Spring Security 的 Vaadin 21。
spring 安全文件,如下所示:
@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);
http.authorizeRequests().antMatchers("/VAADIN/**").permitAll();
super.configure(http);
// This is important to register your login view to the
// view access checker mechanism:
setLoginView(http, LoginView.class);
// Set the default success Url
http.formLogin().defaultSuccessUrl(ApplicationUrl.APP);
// Set the default failure Url
http.formLogin().failureUrl(ApplicationUrl.APP_LOGIN_FAILURE_URL);
}
/**
* 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);
}
}
上传组件被集成到一个Dialog中。
希望有人可以帮助我, 弗洛里安
【问题讨论】:
标签: spring vaadin vaadin-flow