Hi Craig,
In the meantime, I've figured out some workaround for this by extending OAuth2ConnectionFactory and FacebookServiceProvider:
Code:
public class FacebookServiceProviderNS extends FacebookServiceProvider {
private String appNamespace;
public FacebookServiceProviderNS(String clientId, String clientSecret, String appNamespace) {
super(clientId, clientSecret);
this.setAppNamespace(appNamespace);
}
public String getAppNamespace() {
return this.appNamespace;
}
public void setAppNamespace(String appNamespace) {
this.appNamespace = appNamespace;
}
@Override
public Facebook getApi(String accessToken) {
return new FacebookTemplate(accessToken, this.getAppNamespace());
}
}
Code:
public class FacebookConnectionFactoryNS extends OAuth2ConnectionFactory<Facebook> {
public FacebookConnectionFactoryNS(String clientId, String clientSecret, String appNamespace) {
super("facebook", new FacebookServiceProviderNS(clientId, clientSecret, appNamespace), new FacebookAdapter());
}
}
When configuring the connection repository, I use
Code:
@Bean
public ConnectionFactoryLocator connectionFactoryLocator() {
ConnectionFactoryRegistry registry = new ConnectionFactoryRegistry();
...
registry.addConnectionFactory(new FacebookConnectionFactoryNS(clientId, clientSecret, appNamespace));
return registry;
}
This is working, but if you think there might be any problem with the usage, please let me know.
Perhaps this is also the direction of the solution which you are looking for?
Yuval