Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/149.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Spring security Spring Social:无法使用xml配置创建SocialAuthenticationFilter_Spring Security_Spring Social_Spring Social Twitter - Fatal编程技术网

Spring security Spring Social:无法使用xml配置创建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

我想使用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.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>