Problems with python-oauth2 and Yahoo's Fantasy Sports API Problems with python-oauth2 and Yahoo's Fantasy Sports API flask flask

Problems with python-oauth2 and Yahoo's Fantasy Sports API


As kanaka pointed out, yahoo's get_access_token call requires the oauth_callback, and simplegeo/oauth2 does not allow you to specify it easily.

Here are a couple of workarounds:

Instead of simplegeo/python-oauth2, take zbowling/python-oauth2 (which is a fork of simplegeo, but with some nice new code, and bugfixes), and then add an extra parameter:

parameters={'oauth_callback': 'http://example.com/callback/'}

to the Client.request call. Like so:

client = Client(consumer)client.request('https://api.login.yahoo.com/oauth/v2/get_request_token',               method='GET',               parameters={'oauth_callback': 'http://example.com/callback/'})

If you insist on working with simplegeo/python-oauth2 then check out the detailed discussion on problems with simplegeo/oauth2 and yahoo oauth, at this page. It has some code fragments that you can use.


I just tried using python-oauth2 (simplegeo's) and got the same problem.

One problem with simplegeo's implementation is that the oauth_callback is easy to provide in the request token request and according to this it is required: http://developer.yahoo.com/oauth/guide/oauth-requesttoken.html

But even when I force that to 'oob' I still have the problem.

You might try yahoo's own python library and see if that helps (and then post back here what you found): http://github.com/yahoo/yos-social-python. I found that from here: http://developer.yahoo.com/social/sdk/