2017-12-10 18 views
0

このチュートリアルで説明したように、Spring Socialを使用してツイートを投稿しようとしました:https://docs.spring.io/spring-social-twitter/docs/current/reference/htmlsingle/spring social twitter MissingAuthorizationException

new TwitterTemplate(consumerKey, consumerSecret, accessToken, accessTokenSecret); 

アクセストークンは、ここで生成することができます。しかし、私は

TwitterTemplate twitterTemplate = new TwitterTemplate("key", "secret"); 
TweetData tweetData =new TweetData("test screenshot").withMedia(new ByteArrayResource(object.getScreenshot().getBytes())); 
Tweet postResult = twitterTemplate.timelineOperations().updateStatus(tweetData); 

答えて

0

特定の操作がTwitterTemplateと一緒に渡される別のアクセストークンを必要とし、次のように

org.springframework.social.MissingAuthorizationException: Authorization is required for the operation, but the API binding was created without authorization. 

私のコードが見え取得しています:apps.twitter.com/app/"appId"/keys

関連する問題