Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Zahra Rajabi
tweepy
Commits
555f3497
Commit
555f3497
authored
Feb 18, 2014
by
Aaron Hill
Browse files
Removed Basic Auth references
parent
b57b6dfe
Changes
1
Hide whitespace changes
Inline
Side-by-side
docs/auth_tutorial.rst
View file @
555f3497
...
...
@@ -8,53 +8,12 @@ Authentication Tutorial
Introduction
============
Tweepy supports both basic and oauth authentication. Authentication is
handled by tweepy.AuthHandler classes with two implementations
provided:
* OAuthHandler
* BasicAuthHandler
Basic Authentication
====================
Twitter has disabled basic authentication on August 16th 2010 - use OAuth
authentication instead.
Basic authentication uses the user's Twitter username and password for
authenticating with the API. You must query the user for these two
pieces of information before we can authenticate.
Now first we must create an instance of the BasicAuthHandler and pass
into it the username and password::
auth = tweepy.BasicAuthHandler(username, password)
Next we need to create our API instance which will be used for
executing requests to the Twitter API::
api = tweepy.API(auth)
We are now ready to make API calls that are authenticated! Here is a
quick example posting a new tweet to the authenticated user's account::
api.update_status('hello from tweepy!')
Tweepy supports oauth authentication. Authentication is
handled by the tweepy.AuthHandler class.
OAuth Authentication
====================
OAuth is a bit trickier than basic auth, but there are some advantages
to using it:
* You can set a 'from myappname' which will appear in tweets
posted
* More secure since you don't need the user's password
* Your app does not break if the user changes their password in
the future
Tweepy tries to make OAuth as painless as possible for you. To begin
the process we need to register our client application with
Twitter. Create a new application and once you
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment