Spring security Spring Social:无法使用xml配置创建SocialAuthenticationFilter
我想使用XML配置将spring social facebook(spring social 1.1.4和spring social facebook 1.1.1)添加到spring security 4.0.3中 我无法添加SocialAuthenticationFilter:Spring security Spring Social:无法使用xml配置创建SocialAuthenticationFilter,spring-security,spring-social,spring-social-twitter,Spring Security,Spring Social,Spring Social Twitter,我想使用XML配置将spring social facebook(spring social 1.1.4和spring social facebook 1.1.1)添加到spring security 4.0.3中 我无法添加SocialAuthenticationFilter: <b:bean id="socialAuthenticationFilter" class="org.springframework.social.security.SocialAuthenticati
<b:bean id="socialAuthenticationFilter" class="org.springframework.social.security.SocialAuthenticationFilter">
<b:constructor-arg index="0" ref="authenticationManager" />
<b:constructor-arg index="1" ref="userIdSource" />
<b:constructor-arg index="2" ref="usersConnectionRepository" />
<b:constructor-arg index="3" ref="socialAuthenticationServiceLocator" />
</b:bean>
您需要在上下文中定义适当的
socialAuthenticationServiceLocator
<bean id="socialAuthenticationServiceLocator" class="org.springframework.social.security.SocialAuthenticationServiceRegistry">
<property name="authenticationServices">
<list>
<bean class="org.springframework.social.twitter.security.TwitterAuthenticationService">
<constructor-arg value="${twitter.apiKey}" />
<constructor-arg value="${twitter.appSecret}" />
</bean>
</list>
</property>
</bean>
<bean id="socialAuthenticationServiceLocator" class="org.springframework.social.security.SocialAuthenticationServiceRegistry">
<property name="authenticationServices">
<list>
<bean class="org.springframework.social.twitter.security.TwitterAuthenticationService">
<constructor-arg value="${twitter.apiKey}" />
<constructor-arg value="${twitter.appSecret}" />
</bean>
</list>
</property>
</bean>