Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 8 commits
  • 6 files changed
  • 0 commit comments
  • 4 contributors
Commits on Apr 28, 2012
@mart-e mart-e fix import error in tests.py 252aec3
Commits on May 02, 2012
@istruble istruble Updating AUTHORS.
Two different people pointed out the sloppy fix I made
to the TWITTER_CONSUMER_{KEY,SECRET} test values.
Adding both Anisse Astier and Martin Trigaux to AUTHORS.
17e350d
Commits on May 10, 2012
@funkatron funkatron Example for Twitter request_token must be POST, not GET 059d0f7
Commits on May 16, 2012
@maraujop Updating three legged twitter oauth test 8cdfc4f
@maraujop Apparently requests now handles cookies properly
So there is no need to set request.cookies to an emtpy dictionary, also a CookieJar object
is expected to be passed.
30ba7f3
@maraujop Bumping version to 0.4.0 and requiring requests>=0.12.1 b21aecd
@maraujop Merge branch 'patch-1' of git://github.com/funkatron/requests-oauth i…
…nto dev
138679e
@maraujop Merge branch 'dev' of git://github.com/istruble/requests-oauth into dev b16f02f
View
2  AUTHORS
@@ -10,3 +10,5 @@ Contributors
- Christopher Toth <ctoth>
- <jqxl0205>
- Ian Struble <istruble>
+- Anisse Astier <anisse>
+- Martin Trigaux <mart-e>
View
2  README.md
@@ -47,7 +47,7 @@ And a POST example:
Beware that you are not forced to pass the token information to the hook. That way you can retrieve it from the API. Let's see a Twitter example:
client = requests.session(hooks={'pre_request': OAuthHook(consumer_key=consumer_key, consumer_secret=consumer_secret)})
- response = client.get('https://api.twitter.com/oauth/request_token')
+ response = client.post('https://api.twitter.com/oauth/request_token')
response = parse_qs(response.content)
print "Token: %s Secret: %s" % (response['oauth_token'], response['oauth_token_secret'])
View
4 oauth_hook/hook.py
@@ -162,10 +162,6 @@ def __call__(self, request):
if isinstance(request.data, list):
request.data = dict(request.data)
- # Looks like OAuth API providers don't handle cookies well, so we reset them
- # See Github issue #5 https://github.com/maraujop/requests-oauth/issues/5
- request.cookies = {}
-
# Dictionary to OAuth1 signing params
request.oauth_params = {}
View
4 setup.py
@@ -3,7 +3,7 @@
from setuptools import setup, find_packages
-version = '0.3.0'
+version = '0.4.0'
setup(
name='requests-oauth',
@@ -14,7 +14,7 @@
author_email='miguel.araujo.perez@gmail.com',
url='http://github.com/maraujop/requests-oauth',
packages=find_packages(),
- install_requires=['requests', ],
+ install_requires=['requests>=0.12.1', ],
license='BSD',
classifiers=(
'Development Status :: 4 - Beta',
View
4 tests/test_settings.py.template
@@ -2,8 +2,8 @@
TWITTER_ACCESS_TOKEN = ""
TWITTER_ACCESS_TOKEN_SECRET = ""
-TWITTER_CONSUMER_TOKEN = ""
-TWITTER_CONSUMER_TOKEN_SECRET = ""
+TWITTER_CONSUMER_KEY = ""
+TWITTER_CONSUMER_SECRET = ""
RDIO_API_KEY = ""
RDIO_SHARED_SECRET = ""
View
5 tests/tests.py
@@ -87,10 +87,11 @@ def test_three_legged_auth(self):
if yes_or_no.lower() in ['y', 'yes']:
return
+ twitter_oauth_hook = OAuthHook()
for header_auth in (True, False):
# See https://dev.twitter.com/docs/auth/implementing-sign-twitter
# Step 1: Obtaining a request token
- twitter_oauth_hook = OAuthHook(header_auth=header_auth)
+ twitter_oauth_hook.header_auth = header_auth
client = requests.session(hooks={'pre_request': twitter_oauth_hook})
response = client.post('http://api.twitter.com/oauth/request_token', data={'oauth_callback': 'oob'})
@@ -107,7 +108,7 @@ def test_three_legged_auth(self):
oauth_verifier = raw_input('Please enter your PIN:')
# Step 3: Authenticate
- response = client.post('http://api.twitter.com/oauth/access_token', {'oauth_verifier': oauth_verifier, 'oauth_token': oauth_token})
+ response = client.post('http://api.twitter.com/oauth/access_token', {'oauth_verifier': oauth_verifier, 'oauth_token': oauth_token[0]})
response = parse_qs(response.content)
self.assertTrue(response['oauth_token'])
self.assertTrue(response['oauth_token_secret'])

No commit comments for this range

Something went wrong with that request. Please try again.