xdevplatform/Twitter-API-v2-sample-code

Python create-tweet example missing `?oauth_callback=oob`

Closed this issue · 7 comments

Nice find!

I needed to add an extra x_auth_access_type query parameter to get write access:

request_token_url = "https://api.twitter.com/oauth/request_token?oauth_callback=oob&x_auth_access_type=write"

Source: https://developer.twitter.com/en/docs/authentication/api-reference/request_token

zmoon commented

@timborden good to know. I guess I didn't need that because I changed my OAuth settings in Developer Portal from the default read to read/write?

Thanks, @zmoon @timborden, for your feedback. I'm looking into this and will make some changes here if needed.

All versions of this code work for me, but I'm going to go ahead and update all the samples with https://api.twitter.com/oauth/request_token?oauth_callback=oob&x_auth_access_type=write. Thank you for this feedback.

zmoon commented

@JessicaGarson any idea why oauth_callback=oob wasn't needed for you? This page makes it sound like it is always needed in this situation.

If you are using pin-based authorization, you will need to set this to oob.

I think this has to do with some settings on our end, and I know this code worked for some users. I'm still working on getting to the bottom of it, but I'll let you know if I hear of anything. Also worth noting that we've made some auth changes since that page was initially created.

I'm going to close out this issue since these issues have been resolved.