В spring boot приложении есть api часть и интерфейс на vaadin. Хочу для api настроить http basic, а для интерфейса formlogin. в данном варианте работает только http basic, а formlogin не принимает логин-пароль
protected void configure(HttpSecurity http) throws Exception {
http.requestCache()
.requestCache(new CustomRequestCache())
.and().authorizeRequests()
.antMatchers("/v2/api-docs",
"/configuration/ui",
"/swagger-resources/**",
"/configuration/security",
"/swagger-ui.html",
"/webjars/**",
"/configuration/**",
"/swagger*/**",
"/console/**").permitAll()
.requestMatchers(SecurityUtils::isFrameworkInternalRequest).permitAll()
.antMatchers(HttpMethod.GET).hasAnyRole(COMMITTEE_MEMBER,BUSINESS_ADMINISTRATOR)
.antMatchers(HttpMethod.DELETE).denyAll()
.antMatchers(HttpMethod.HEAD).denyAll()
.antMatchers(HttpMethod.OPTIONS).denyAll()
.antMatchers(HttpMethod.PATCH).denyAll()
.antMatchers(HttpMethod.POST).denyAll()
.antMatchers(HttpMethod.PUT).denyAll()
.antMatchers(HttpMethod.TRACE).denyAll()
.anyRequest().authenticated().and()
.httpBasic().and()
.csrf().disable()
.addFilter(new AuthorizationFilter(authenticationManager(), userRepository))
.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and().formLogin()
.loginPage(LOGIN_URL).permitAll()
.loginProcessingUrl(LOGIN_PROCESSING_URL)
.failureUrl(LOGIN_FAILURE_URL)
.and().logout().logoutSuccessUrl(LOGOUT_SUCCESS_URL);
}
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
auth.inMemoryAuthentication()
.withUser("user")
.password(passwordEncoder().encode("******"))
.roles(ADMINISTRATOR);
}
public UserDetailsService userDetailsService() {
UserDetails user =
User.withUsername("admin")
.password("{noop}*******")
.roles(ADMINISTRATOR)
.build();
return new InMemoryUserDetailsManager(user);
}
Как настроить их на совместную деятельность?