| CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 24 Dec 2025 05:20:46 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20091026052756
location: https://web.archive.org/web/20091026052756/https://github.com/simplegeo/python-oauth2/tree/master
server-timing: captures_list;dur=0.623269, exclusion.robots;dur=0.066942, exclusion.robots.policy;dur=0.056433, esindex;dur=0.009811, cdx.remote;dur=20.484467, LoadShardBlock;dur=323.212904, PetaboxLoader3.resolve;dur=76.492303, PetaboxLoader3.datanode;dur=120.803272
x-app-server: wwwb-app221-dc8
x-ts: 302
x-tr: 372
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: wb-p-SERVER=wwwb-app221; path=/
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 301
server: nginx
date: Wed, 24 Dec 2025 05:20:47 GMT
content-type: text/html; charset=utf-8
content-length: 107
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Mon, 26 Oct 2009 05:27:56 GMT
x-archive-orig-connection: close
x-archive-orig-status: 301 Moved Permanently
location: https://web.archive.org/web/20091026052756/https://github.com/simplegeo/python-oauth2
x-archive-orig-x-runtime: 4ms
x-archive-orig-content-length: 107
x-archive-orig-cache-control: no-cache
cache-control: max-age=1800
memento-datetime: Mon, 26 Oct 2009 05:27:56 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_12_20091026033336_crawl101-c/52_12_20091026051032_crawl101.arc.gz
server-timing: captures_list;dur=0.474960, exclusion.robots;dur=0.016292, exclusion.robots.policy;dur=0.007163, esindex;dur=0.009253, cdx.remote;dur=22.143708, LoadShardBlock;dur=245.733172, PetaboxLoader3.resolve;dur=485.277852, PetaboxLoader3.datanode;dur=221.444743, load_resource;dur=575.897929
x-app-server: wwwb-app221-dc8
x-ts: 301
x-tr: 865
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 24 Dec 2025 05:20:49 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Mon, 26 Oct 2009 05:27:56 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "7ce848997867f92b124ccd294ee28167"
x-archive-orig-x-runtime: 118ms
x-archive-orig-content-length: 28401
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Mon, 26 Oct 2009 05:27:56 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_12_20091026033336_crawl101-c/52_12_20091026051032_crawl101.arc.gz
server-timing: captures_list;dur=0.539174, exclusion.robots;dur=0.023346, exclusion.robots.policy;dur=0.013265, esindex;dur=0.009615, cdx.remote;dur=1024.062327, LoadShardBlock;dur=150.200120, PetaboxLoader3.datanode;dur=179.694103, PetaboxLoader3.resolve;dur=144.306665, load_resource;dur=180.030627
x-app-server: wwwb-app221-dc8
x-ts: 200
x-tr: 1416
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-as: 14061
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
simplegeo's python-oauth2 at master - GitHub
This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
| Description: | A fully tested, abstract interface to creating OAuth clients and servers. edit |
| Homepage: | edit |
| Public Clone URL: |
git://github.com/simplegeo/python-oauth2.git
Give this clone URL to anyone.
git clone git://github.com/simplegeo/python-oauth2.git
|
| Your Clone URL: |
Use this clone URL yourself.
git clone git@github.com:simplegeo/python-oauth2.git
|
Chris Lea (author)
Wed Oct 21 23:43:43 -0700 2009
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Mon Oct 12 10:26:04 -0700 2009 | Moved things around so testing works with setup... [joestump] |
| |
LICENSE.txt | Tue May 19 15:11:43 -0700 2009 | python lib: added MIT license git-svn-id: http... [leah] |
| |
README.md | Wed Oct 21 10:47:22 -0700 2009 | Updated README. [joestump] |
| |
debian/ | Wed Oct 21 23:43:43 -0700 2009 | added debian packaging [Chris Lea] |
| |
example/ | Mon Oct 12 10:26:04 -0700 2009 | Moved things around so testing works with setup... [joestump] |
| |
oauth2/ | Wed Oct 21 10:55:39 -0700 2009 | Added proper copyrights. [joestump] |
| |
setup.cfg | Mon Oct 12 10:26:04 -0700 2009 | Moved things around so testing works with setup... [joestump] |
| |
setup.py | Wed Oct 21 10:53:37 -0700 2009 | Changed setup.py for PyPi release. [joestump] |
| |
tests/ | Wed Oct 21 10:23:21 -0700 2009 | Switched name to oauth2. [joestump] |
README.md
Overview
This code was originally forked from Leah Culver and Andy Smith's oauth.py code. Some of the tests come from a fork by Vic Fryzel, while a revamped Request class and more tests were merged in from Mark Paschal's fork. A number of notable differences exist between this code and its forefathers:
- 100% unit test coverage.
- The
DataStoreobject has been completely ripped out. While creating unit tests for the library I found several substantial bugs with the implementation and confirmed with Andy Smith that it was never fully baked. - Classes are no longer prefixed with
OAuth. - The
Requestclass now extends fromdict. - The library is likely no longer compatible with Python 2.3.
- The
Clientclass works and extends fromhttplib2. It's a thin wrapper that handles automatically signing any normal HTTP request you might wish to make.
Signing a Request
import oauth2 as oauth
import time
# Set the API endpoint
url = "https://example.com/photos"
# Set the base oauth_* parameters along with any other parameters required
# for the API call.
params = {
'oauth_version': "1.0",
'oauth_nonce': oauth.generate_nonce(),
'oauth_timestamp': int(time.time())
'user': 'joestump',
'photoid': 555555555555
}
# Set up instances of our Token and Consumer. The Consumer.key and
# Consumer.secret are given to you by the API provider. The Token.key and
# Token.secret is given to you after a three-legged authentication.
token = oauth.Token(key="tok-test-key", secret="tok-test-secret")
consumer = oauth.Consumer(key="con-test-key", secret="con-test-secret")
# Set our token/key parameters
params['oauth_token'] = tok.key
params['oauth_consumer_key'] = con.key
# Create our request. Change method, etc. accordingly.
req = oauth.Request(method="GET", url=url, parameters=params)
# Sign the request.
signature_method = oauth.SignatureMethod_HMAC_SHA1()
req.sign_request(signature_method, consumer, token)
Using the Client
The oauth2.Client is based on httplib2 and works just as you'd expect it to. The only difference is the first two arguments to the constructor are an instance of oauth2.Consumer and oauth2.Token (oauth2.Token is only needed for three-legged requests).
import oauth2 as oauth
# Create your consumer with the proper key/secret.
consumer = oauth.Consumer(key="your-twitter-consumer-key",
secret="your-twitter-consumer-secret")
# Request token URL for Twitter.
request_token_url = "https://twitter.com/oauth/request_token"
# Create our client.
client = oauth.Client(consumer)
# The OAuth Client request works just like httplib2 for the most part.
resp, content = client.request(request_token_url, "GET")
print resp
print content
This feature is coming soon. Sit tight!







