Twitter oauth webapp with twitter4j gives me 403 exception

Hi guys i have problems using twitter4j for webapp oauth, code

//I changed from val to var 
var twit = TwitterFactory.getSingleton
   twit.setOAuthConsumer("oAUMN69x14PKmMhjr3RyQ","1C4fAnW3LAZYG8M4Sl0n9KzYcExW30xTL8S9U")
   val reqst = twit.getOAuthRequestToken

      

right now i'm just testing it so i create url reqst.getAuthorizationURL

and copy oauth_verifier from url

not required to use oauth_token ?

http://127.0.0.1/auth/twitter/callback?oauth_token=2sGINg *** n6YSJ4 & oauth_verifier = xNdDA ***** OfL

val tok = twit.getOAuthAccessToken(reqst.getToken, "xNdDA...OfL")

      

this line raises an error

twitter4j.TwitterException: 403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (https://support.twitter.com/articles/15364-about-twitter-limits-update-api-dm-and-following).
The screen name / password combination seems to be invalid.
  at twitter4j.auth.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:165)
  at twitter4j.TwitterBaseImpl.getOAuthAccessToken(TwitterBaseImpl.java:372)
  ... 30 elided
Caused by: twitter4j.TwitterException: 403:The request is understood, but it has been refused. An accompanying error message will explain why. This code is used when requests are being denied due to update limits (https://support.twitter.com/articles/15364-about-twitter-limits-update-api-dm-and-following).
<?xml version="1.0" encoding="UTF-8"?><errors><error code="87">Client is not permitted to perform this action</error></errors>

  at twitter4j.HttpClientImpl.handleRequest(HttpClientImpl.java:164)
  at twitter4j.HttpClientBase.request(HttpClientBase.java:57)
  at twitter4j.HttpClientBase.post(HttpClientBase.java:86)
  at twitter4j.auth.OAuthAuthorization.getOAuthAccessToken(OAuthAuthorization.java:158)
  ... 31 more

      

what could be a mistake? .. thanks !!

+3


source to share





All Articles