Я хочу получить весеннюю форму аутентификации безопасности. Здесь часть файла spring-security.xml
<bean id="authenticationFilter" class="com.portal.framework.web.security.CustomAuthenticationFilter">
<property name="authenticationManager" ref="authenticationManager" />
<property name="filterProcessesUrl" value="/login/validate" />
<property name="usernameParameter" value="usernameOrEmail" />
<property name="passwordParameter" value="password" />
<property name="authenticationSuccessHandler" ref="restAuthenticationSuccessHandler" />
<property name="authenticationFailureHandler" ref="restAuthenticationFailureHandler" />
</bean>
<authentication-manager alias="authenticationManager" xmlns="http://www.springframework.org/schema/security">
<authentication-provider ref="customAuthenticationProvider" />
</authentication-manager>
Я получил ошибку: не определен bean-компонент с именем «customAuthenticationProvider».
Разрешение bean-компонентов выполняется конфигурацией Java следующим образом:
@Configuration
@ComponentScan(basePackages = {"com.portal"})
public class MainConfiguration {
@Bean
public CustomAuthenticationProvider customAuthenticationProvider() {
return new CustomAuthenticationProvider();
}
}
Есть ли проблемы с этой конфигурацией?