Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid response from Twitter API GET users/show: 403 #6

Open
woo2669 opened this issue Jun 4, 2023 · 2 comments
Open

Invalid response from Twitter API GET users/show: 403 #6

woo2669 opened this issue Jun 4, 2023 · 2 comments

Comments

@woo2669
Copy link

woo2669 commented Jun 4, 2023

I have set the environment variables TWAUTH_APP_CONSUMER_KEY and TWAUTH_APP_CONSUMER_SECRET. App permissions are also set to Read and Write and Direct Message. The type of app is a Web App, Automated App, or Bot. The Callback URI / Redirect URL is http://127.0.0.1:5000/callback.

When running the program, I am able to retrieve values for oauth_denied, oauth_token, oauth_verifier, and oauth_store correctly. The browser also redirects to the Twitter authentication screen. However, upon returning to the application, an error occurs. I have tried adjusting the settings, but the issue persists.

@khoitx-ugaming
Copy link

For anyone having this issue, you can go into twauth-web.py and edit

show_user_url = 'https://api.twitter.com/1.1/users/show.json'

into

show_user_url = 'https://api.twitter.com/1.1/account/verify_credentials.json'

and it should work again

Reference: step 3 of

https://developer.twitter.com/en/docs/authentication/guides/log-in-with-twitter#convert-request-to-access-token

"A successful response contains the oauth_token, oauth_token_secret parameters. The token and token secret should be stored and used for future authenticated requests to the Twitter API. To determine the identity of the user, use GET account/verify_credentials."

@kang000feng
Copy link

thank you friend, with your solution i had fix 403 error. but after that i got anohter error , may i ask do you have encountered this error? and how to Set the API connection to v2 and change the endpoint with this twauth-web project? :

❌ Error: [{'message': 'You currently have access to a subset of Twitter API v2 endpoints and limited v1.1 endpoints (e.g. media post, oauth) only. If you need access to this endpoint, you may need a different access level. You can learn more here: https:developer.twitter.com/en/portal/product', 'code': 453}]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants