Spring Social - 404 error for facebook login

人走茶凉 提交于 2019-12-07 03:26:54

问题


I have spring 3.1 with spring security login in my app. I am trying to add facebook login using spring social to it. It goes to the facebook login page but post log in it throws a 404 error. I have this in the URL:

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

Here goes my spring social config:

<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> 

Any thoughts?


回答1:


I too just suddently happened to get a redirect to signin?error=provider#_=_.

The reason was that just before this "error message" repeatedly happened, I updated my local JDK installation. With this new JDK installation, also any changes to my Java installation security settings were resetted to "fresh installation defaults". In particular, my manually installed UnlimitedJCEPolicy was no longer available. Reinstalling the UnlimitedJCEPolicy solved the problem in my case.

In my particular case, I'm not using a noOpText() TextEncryptor, but a queryableText(..) TextEncryptor.




回答2:


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.



来源:https://stackoverflow.com/questions/11740105/spring-social-404-error-for-facebook-login

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!