我使用spring-social-facebook库让用户通过Facebook登录到我的应用程序并获取有关用户的一些基本信息。看起来spring-social-facebook仅记录有错误的响应。
问题是:
我在SocialConfigurer实现中添加了Facebook ConnectionFactory:
@Configuration
@EnableSocial
public class SocialConfiguration implements SocialConfigurer {
@Value("${facebook.app.id}")
private String appId;
@Value("${facebook.app.secret}")
private String appSecret;
@Override
public void addConnectionFactories(ConnectionFactoryConfigurer connectionFactoryConfigurer, Environment environment) {
connectionFactoryConfigurer.addConnectionFactory(
new FacebookConnectionFactoryExt(appId, appSecret));
}
@Override
public UserIdSource getUserIdSource() {
return new AuthenticationNameUserIdSource();
}
@Override
public UsersConnectionRepository getUsersConnectionRepository(ConnectionFactoryLocator connectionFactoryLocator) {
return new InMemoryUsersConnectionRepository(connectionFactoryLocator);
}
}
谢谢