For a project we're trying to use spring social to post twitter and facebook updates.
I'm using a TwitterTemplate for communication with twitter like so:
For the FacebookTemplate, this approach works perfectly. I keep on struggling with the TwitterTemplate. The accesstoken and accestokensecret are obtained by the OAuth dance client side and stored by the backend.Code:public boolean postTweet(String pAccessToken, String pAccessTokenSecret, String pTweet){ TwitterTemplate tTwitter = new TwitterTemplate(fTwitterApiKey, fTwitterApiSecret, pAccessToken, pAccessTokenSecret); if(pTweet == null || "".equals(pTweet)) throw new IllegalArgumentException("Tweet is empty"); try{ tTwitter.updateStatus(pTweet); } catch(SocialException e){ return false; } return true; }
When I try to post a tweet I get the following exception:
I know requests to the twitter api should be signed, but my expectation was for spring social to handle that. Also, I fail to see how I could supply the TwitterTemplate with a signature.HTML Code:org.springframework.social.AccountNotConnectedException: Incorrect signature


Reply With Quote