bear / python-twitter

A Python wrapper around the Twitter API.
Apache License 2.0
3.41k stars 955 forks source link

How to implement "login with twitter?" #629

Open fluffy-critter opened 4 years ago

fluffy-critter commented 4 years ago

Hi, python-twitter seems pretty comprehensive from a code standpoint, but the docs leave out a bunch of key details. In particular, how to actually provide a login flow for a "login with Twitter" mechanism.

When I register an app I only have a client_key/client_secret, and while I can figure out from other examples how to get an access_token_key/access_token_secret through a CLI/PIN flow, I have no idea how to use python-twitter to get them via web callback. Basically, what's missing from any of the examples I can find online:

  1. How to generate the Twitter login URL (with the oauth_token/callback/etc.)
  2. How to use the results of the callback to get the access token so that I can do the other things with the (well-documented) API

Are there any examples out there, and could those be added to the docs?

Thanks!