Simon Willison’s Weblog

How do you correctly send the oauth_verifier parameter using python-oauth2 and the Twitter API?

My answer to How do you correctly send the oauth_verifier parameter using python-oauth2 and the Twitter API? on Quora

This seems relevant: http://groups.google.com/group/t...

Aha! I think I’ve solved it. Twitter doesn’t send the oauth_verifier argument unless you specify an oauth_callback when requesting the request token.

Here’s a related discussion:

https://github.com/simplegeo/pyt...

So, my solution was to use this:

resp, content = client.request(request_token_url, “POST”,
body = ’oauth_callback=http://lanyrd.com/twitter/done/’
)

And then later, in my callback function:

if ’oauth_verifier’ in request.GET:
token.set_verifier(request.GET[’oauth_verifier’])

This is How do you correctly send the oauth_verifier parameter using python-oauth2 and the Twitter API? by Simon Willison, posted on 5th December 2010.

Tagged , ,

Next: What are some scalable OAuth and OpenID server implementations?

Previous: What are some ways I can get the word out about my startup/entrepreneur focused conference?