I tried to integrate Spring Social on one of my Spring MVC projects and I followed the steps described in this blog ans I also used as reference the Spring Projects found on Github, but I was confused on this set of codes found on the github projects.
@Bean
@Scope(value = "request",proxyMode = ScopedProxyMode.INTERFACES)
public Facebook facebook(ConnectionRepository connectionRepository){
Connection<Facebook> connection = connectionRepository.findPrimaryConnection(Facebook.class);
return connection != null ? connection.getApi() : new FacebookTemplate();
}
The primary connection for facebook cannot be found even though the user clicks the "Sign In Using Facebook" button and thus it returns a new instance of FacebookTemplate and when I try use it I always get an access deined because I don't have any authentication/access token. Are there any solution to get the token key?