cdleong / pyfantasy

Not Playing Fantasy Sports
GNU General Public License v3.0
1 stars 0 forks source link

Documentation: Process for auth-key generation for Yahoo API #19

Closed FuzzyMcGraw closed 5 years ago

FuzzyMcGraw commented 5 years ago

In trying to run the yahoo draft advisor, it requests login to the OAuth page, but I encounter an error page. Can you document how you generated your auth keys?

Player 2 has entered the game

cdleong commented 5 years ago

Essentially, you have to make an app on the Yahoo Developer site.

Trying to recreate the steps: First, I think I made an app: https://developer.yahoo.com/apps/create/ image

image

I selected "installed application" and "read/write permissions."

You then have access to the keys and such:

image

You put those in the file "auth_keys.txt" in pyfantasy, like so:

consumer_secret: 6d2ed90638f1c84a70fc51fd48da867967df3c9d
consumer_key: dj0yJmk9WElQREZjaVRhYUNXJnM9Y29uc3VtZXJzZWNyZXQmc3Y9MCZ4PWEx

More Fantasy API info: https://developer.yahoo.com/fantasysports/

cdleong commented 5 years ago

I think this page also relevant: https://developer.yahoo.com/dsp/api/docs/authentication/enable-oauth.html

cdleong commented 5 years ago

And perhaps this: https://developer.yahoo.com/oauth2/guide/

cdleong commented 5 years ago

Actually, I guess I can just... include an auth_keys.txt in the repo, with the client_ID?

cdleong commented 5 years ago

https://github.com/thorrr/YahooSports README has more info

cdleong commented 5 years ago

Upon digging into it more, I think only the ID should be necessary, but the YahooSports repo requires both?

On this page, they only use the CLIENT_ID: https://developer.yahoo.com/dsp/api/docs/authentication/enable-oauth.html

https://api.login.yahoo.com/oauth2/request_auth?client_id=dj0yJmk9aG82MHR6TDM3YUhkJmQ9WVdrOVN6SnNZemRpTjJVbWNHbzlNQS0tJnM9Y29uc3VtZXJzZWNyZXQmeD1hMg--&redirect_uri=oob&response_type=code&language=en-us

seems to work fine. No "secret" required.

cdleong commented 5 years ago

This page confirms you share the ID, but not the secret: https://www.oauth.com/oauth2-servers/client-registration/client-id-secret/

FuzzyMcGraw commented 5 years ago

Excellent. No need to include AuthKeys in the repo, probably shouldn't for safety reasons. Each user needs their own client_ID too, I think.