当我尝试通过Facebook登录时,使用spring social我会收到以下错误:
WARN org.springframework.web.client.RestTemplate - POST请求 “https://graph.facebook.com/oauth/access_token”导致400(差错 请求);调用错误处理程序
请建议
Configurations
Version of Spring
<org.springframework.version>3.2.0.RELEASE</org.springframework.version>
<org.springframework.security.version>3.1.0.RELEASE</org.springframework.security.version>
<org.spring.social>1.1.0.RELEASE</org.spring.social>
<bean id="socialAuthenticationFilter"
class="org.springframework.social.security.SocialAuthenticationFilter">
<constructor-arg index="0" ref="authenticationManager" />
<constructor-arg index="1" ref="userIdSource" />
<constructor-arg index="2" ref="usersConnectionRepository" />
<constructor-arg index="3"
ref="appSocialAuthenticationServiceRegistry" />
<!-- Sets the url of the registration form. -->
<property name="signupUrl" value="/user/register" />
</bean>
<!-- Configures the social authentication provider which processes authentication
requests made by using supported social authentication services (FB, Twitter
and so on). -->
<bean id="socialAuthenticationProvider"
class="org.springframework.social.security.SocialAuthenticationProvider">
<constructor-arg index="0" ref="usersConnectionRepository" />
<constructor-arg index="1" ref="socialUserDetailsService" />
</bean>
<!-- service registry will holds connection factory of each social provider -->
<bean id="appSocialAuthenticationServiceRegistry"
class="org.ecomm.social.model.AppSocialAuthenticationServiceRegistry">
<constructor-arg>
<list>
<ref bean="facebookAuthenticationService" />
<ref bean="googleAuthenticationService" />
</list>
</constructor-arg>
</bean>
<bean id="facebookAuthenticationService"
class="org.springframework.social.facebook.security.FacebookAuthenticationService">
<constructor-arg name="apiKey" value="<apiKey>" />
<constructor-arg name="appSecret"
value="<appSecret>" />
</bean>
<bean id="googleAuthenticationService"
class="org.springframework.social.google.security.GoogleAuthenticationService">
<constructor-arg name="apiKey"
value="<apiKey>" />
<constructor-arg name="appSecret" value="<appSecret>" />
</bean>
<bean id="socialUserDetailsService" class="org.ecomm.service.impl.SocialUserDetailsServiceImpl">
</bean>
<bean id="usersConnectionRepository" class="org.ecomm.social.mongo.MongoUsersConnectionRepository">
<constructor-arg ref="connectionService" />
<constructor-arg ref="appSocialAuthenticationServiceRegistry" />
<constructor-arg ref="textEncryptor" />
<property name="connectionSignUp" ref="connectionSignUp" />
</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="connectionService" class="org.ecomm.social.mongo.MongoConnectionService">
<constructor-arg index="0" ref="mongoTemplate" />
<constructor-arg index="1" ref="connectionConverter" />
</bean>
<bean id="connectionConverter" class="org.ecomm.social.mongo.ConnectionConverter">
<constructor-arg index="0"
ref="appSocialAuthenticationServiceRegistry" />
<constructor-arg index="1" ref="textEncryptor" />
</bean>
<bean id="userIdSource"
class="org.springframework.social.security.AuthenticationNameUserIdSource" />
<bean id="connectionSignUp" class="org.ecomm.social.model.AppConnectionSignUp" />
<bean id="textEncryptor" class="org.springframework.security.crypto.encrypt.Encryptors"
factory-method="noOpText" />
<bean id="connectController" class="org.springframework.social.connect.web.ConnectController">
<constructor-arg ref="appSocialAuthenticationServiceRegistry" />
<constructor-arg ref="usersConnectionRepository" />
</bean>
<bean id="signInAdapter" class="org.ecomm.service.impl.SpringSecuritySignInAdapter"></bean>
<bean id="providerSignInController"
class="org.springframework.social.connect.web.ProviderSignInController">
<constructor-arg ref="appSocialAuthenticationServiceRegistry" />
<constructor-arg ref="usersConnectionRepository" />
<constructor-arg ref="signInAdapter" />
</bean>
Google Plus代码在此配置下正常运行。 但是,当我在春季社交脸书网上运行时,我正面临着这个问题 WARN org.springframework.web.client.RestTemplate - POST请求 “https://graph.facebook.com/oauth/access_token”导致400(差错 请求);调用错误处理程序
我尝试寻找解决方案,但无法找到任何解决方案。 请说明缺少哪部分配置。