0

当我单击 /signIn/facebook 按钮时,它会将我重定向到我授权的 facebook 页面,然后将我重定向到我的 redirectUrl,但参数错误 = 提供者。我做错了什么?据我所知,它应该重定向到 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>
4

0 回答 0