6

我的应用程序中有 spring 3.1 和 spring 安全登录。我正在尝试使用 spring social 添加 facebook 登录。它进入 facebook 登录页面,但登录后会引发 404 错误。我在网址中有这个:

http://localhost:8080/TestProject/signin?error=provider#_=_

这是我的春季社交配置:

<bean class="org.springframework.social.connect.web.ProviderSignInController">
<!-- relies on by-type autowiring for the constructor-args -->    
<constructor-arg ref="signInAdapter" />
</bean>

<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="${fb.id}" />
            <constructor-arg value="${fb.passwrd}" />               
        </bean>
    </list>
</property>
</bean>

<bean id="connectionRepository" factory-method="createConnectionRepository" 
  factory-bean="usersConnectionRepository" scope="request">
<constructor-arg value="#{request.userPrincipal.name}" />
<aop:scoped-proxy proxy-target-class="false" />
</bean>

<bean id="signInAdapter" class="com.Test.social.SimpleSignInAdapter"/>

<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="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors" 
        factory-method="noOpText" />
 </beans> 

有什么想法吗?

4

2 回答 2

1

我也只是突然碰巧重定向到signin?error=provider#_=_.

原因是在此“错误消息”反复发生之前,我更新了本地 JDK 安装。通过这个新的 JDK 安装,对我的 Java 安装安全设置的任何更改都被重置为“全新安装默认值”。特别是,我手动安装的UnlimitedJCEPolicy不再可用。重新安装 UnlimitedJCEPolicy 解决了我的问题

在我的特殊情况下,我没有使用 a noOpText() TextEncryptor,而是 a queryableText(..) TextEncryptor

于 2013-03-16T01:48:33.937 回答
0

What spring social version you are using? (must be 1.0.X)

Did you create a facebook application? (you need to provide application key/secret in FacebookConnectionFactory constructor). It seems you are using your facebook user/password.

于 2012-07-31T14:13:10.147 回答