如何在java类中实现这一点?
<bean id="rememberMeFilter" class=
"org.springframework.security.web.authentication.rememberme.RememberMeAuthenticationFilter">
<property name="rememberMeServices" ref="rememberMeServices"/>
<property name="authenticationManager" ref="authenticationManager" />
</bean>
<bean id="rememberMeServices" class=
"org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices">
<property name="userDetailsService" ref="userService"/>
<property name="key" value="some-string"/>
</bean>
<bean id="rememberMeAuthenticationProvider" class=
"org.springframework.security.authentication.RememberMeAuthenticationProvider">
<property name="key" value="some-string"/>
</bean>
并在java类中禁用自动配置
auto-config="false"
1条答案
按热度按时间91zkwejq1#
为了节省时间和避免错误,我将给出不同的建议。而不是使用
@Bean
,您可以在使用时包含整个现有的application context.xml文件@ImportResource
注解@Configuration
/@SpringBootApplication
.裁判:https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/context/annotation/importresource.html