Hey there,
I’m using twitter4j and I don’t know how I can get a new permission to send a tweet for a user on my webapp.
the callback and verifying works perfect:
@RequestMapping(value = “about/callback”, method = { RequestMethod.GET, RequestMethod.POST })
public ModelAndView getAboutTest(
ModelMap model,
Locale locale,
@ModelAttribute(AbstractNavigationController.NAVIGATION) Navigation navigation,
HttpServletRequest request) {
TwitterUtils twitter = new TwitterUtils(myAccessToken);
String verifier = request.getParameter("oauth_verifier");
twitter4j.User user = twitter.verify(verifier);
ModelAndView twitModel = new ModelAndView("twittertest");
twitModel.addObject("verifier", verifier);
return twitModel;
After verifying i’m on my twittertest.jsp:
Tweet here:
<input type="submit" class="button" value="Tweet" />
<input id="verifier" name="verifier" type="text" style="visibility:hidden" value="${verifier}"/>
</div>
now i send the msg and the verifier-string (is this still needed to get a new authentification again?? ) to …about/test after i click on the submit-button.
this starts the new controller for about/test, but when I use my consumer key/secret, accesstoken/secret from the callback and the verifier string, i get this error:
401:Authentication credentials (https://dev.twitter.com/docs/auth) were missing or incorrect…
…Invalid / expired Token…
So to my question:
How can i get a 2nd authentication to tweet?
Isn’t that possible with a new twitter instanz?
If not, does anyone have an idea how I can solve this issue?
Would be really nice if someone could help me out.