Furkan Suren
Furkan Suren

Reputation: 51

Error while redirecting to Twitter authorization URL

I was trying to authorize my app using tweepy. But when redirected to the authorization url, i see a Twitter page like this:

"Failed to grant access to the application. Try going back and logging in again."

and an error like this:

oauthlib.oauth2.rfc6749.errors.MissingCodeError: (missing_code) Missing code parameter in response.


I'm using OAuth2.0;

oauth2_user_handler = tweepy.OAuth2UserHandler(
    client_id=oauth_id,
    redirect_uri=callback_url,
    scope=["tweet.post", "tweet.read", "tweet.write", "users.read", "follows.read", "follows.write", "like.read", "like.write", "offline.access"],
    client_secret=oauth_secret
    )

auth_link = oauth2_user_handler.get_authorization_url()

My authorization url is something like that: https://twitter.com/i/oauth2/authorize?response_type=code&client_id=Q0ZxT3FyMzFsWlFHWkNoNHc5QjM6MTpjaQ&redirect_uri=https%3A%2F%2Fd7db-212-252-142-151.ngrok-free.app%2Fcallback&scope=tweet.post+tweet.read+tweet.write+users.read+follows.read+follows.write+like.read+like.write+offline.access&state=a0smv3ENkUJVcisbJNwnwuMf585N36&code_challenge=sNDSO0EWOR9pjN5vwRfhA59O2v28AS7vmArnGRPl5Yo&code_challenge_method=S256

Why i can't reach to the authorization page properly?

Upvotes: 1

Views: 1055

Answers (1)

John
John

Reputation: 11

I'm pretty sure the Twitter API is not available anymore since Musk bought it out. Could be wrong but I'm pretty sure that's why it's not working.

Upvotes: 1

Related Questions