Spring社交提供者=?错误

时间:2012-06-25 09:32:18

标签: java spring-social

当我点击/ signIn / facebook按钮时,它会将我重定向到我授权的Facebook页面,然后将其重定向到我的redirectUrl,但是带有parametr error = provider。我做错了什么?据我所知,它应重定向到SignInAdapter并比较userIds或类似的东西。我该如何调试这些。为什么它不起作用。我的signInController应该将我重定向到注册页面不是吗?这是我的配置:

<?xml version="1.0" encoding="UTF-8"?>

<beans xmlns="http://www.springframework.org/schema/beans"
    xmlns:mvc="http://www.springframework.org/schema/mvc" xmlns:tx="http://www.springframework.org/schema/tx"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:context="http://www.springframework.org/schema/context"
    xmlns:aop="http://www.springframework.org/schema/aop" xmlns:util="http://www.springframework.org/schema/util"
    xsi:schemaLocation="
        http://www.springframework.org/schema/beans
        http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
        http://www.springframework.org/schema/aop 
        http://www.springframework.org/schema/aop/spring-aop-3.0.xsd"
    default-lazy-init="true">

    <bean id="connectionFactoryLocator"
        class="org.springframework.social.connect.support.ConnectionFactoryRegistry">
        <property name="connectionFactories">
            <list>
                <bean
                    class="org.springframework.social.facebook.connect.FacebookConnectionFactory">
                    <constructor-arg value="${facebook.appId}" />
                    <constructor-arg value="${facebook.appSecret}" />
                </bean>
            </list>
        </property>
    </bean>

    <bean id="usersConnectionRepository"
        class="org.springframework.social.connect.jdbc.JdbcUsersConnectionRepository">
        <constructor-arg ref="dataSource" />
        <constructor-arg ref="connectionFactoryLocator" />
        <constructor-arg ref="textEncryptor" />
    </bean>

    <bean id="dataSource"
        class="org.springframework.jdbc.datasource.DriverManagerDataSource">
        <property name="driverClassName" value="com.mysql.jdbc.Driver" />
        <property name="url" value="jdbc:mysql://localhost:3306/shop" />
        <property name="username" value="root" />
        <property name="password" value="root" />
    </bean>

    <bean id="connectionRepository" factory-method="createConnectionRepository"
        factory-bean="usersConnectionRepository" scope="request">
        <constructor-arg value="guest" />
        <aop:scoped-proxy proxy-target-class="false" />
    </bean>

    <bean class="org.springframework.social.connect.web.ProviderSignInController">
        <constructor-arg ref="simpleSignInAdapter" />
        <property name="applicationUrl" value="${application.url}" />
        <property name="signUpUrl" value="/signup" />
    </bean>
    <bean id="simpleSignInAdapter" class="com.social.SimpleSignInAdapter" />


    <bean class="org.springframework.social.connect.web.ConnectController">
        <!-- relies on by-type autowiring for the constructor-args -->
        <property name="applicationUrl" value="${application.url}" />
    </bean>

    <bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors"
        factory-method="noOpText" />
</beans>

0 个答案:

没有答案