public
Description: An HTTP proxy for signing OAuth requests
Homepage:
Clone URL: git://github.com/mojodna/oauth-proxy.git
name age message
file .gitignore Tue Apr 22 18:09:44 -0700 2008 refactored to allow it to run from twistd directly [mojodna]
file README.markdown Thu May 07 01:56:10 -0700 2009 better docs Reflect that a recent version of T... [mojodna]
file TODO.markdown Thu May 07 02:10:35 -0700 2009 basic TODOs [mojodna]
directory oauth/ Mon Apr 21 18:08:39 -0700 2008 removed pycs [mojodna]
directory oauth_proxy/ Thu May 07 01:45:59 -0700 2009 opt type coercion doesn't work with Python 2.5.1 [mojodna]
directory twisted/ Sun May 11 08:55:12 -0700 2008 doc cleanup [mojodna]
README.markdown

OAuth Proxy

I am an OAuth proxy server. You can pass unsigned requests to me and I will sign them using OAuth before sending them to their eventual destination.

At the moment, tokens and consumer keys are configurable only at start-time, so individual proxies are limited to a single pair at a time.

Running

Run the proxy with twistd:

twistd -n oauth_proxy \
  --consumer-key <consumer key> \
  --consumer-secret <consumer secret> \
  [--token <token>] \
  [--token-secret <token secret>] \
  [-p <proxy port>] \
  [--ssl]

"." may need to be in your PYTHONPATH in order for this to work. You'll also need a relatively modern version of Twisted for this to work; OS X 10.5 comes with 2.5.0, which is too old. 8.2.0 (installed via easy_install twisted) appears to work just fine.

Running as a daemon

You may run the proxy with twistd directly (omitting the -n argument) or you may generate a pre-configured tap, which can then be packaged and distributed. To generate a tap:

mktap oauth_proxy \
  --consumer-key <consumer key> \
  --consumer-secret <consumer secret> \
  [--token <token>] \
  [--token-secret <token secret>] \
  [-p <proxy port>] \
  [--ssl]

To run the tap (using the settings that were provided when creating it):

twistd -f oauth_proxy.tap

Using

This proxy can be used with command-line tools and web browsers alike.

To use it with curl:

curl -x localhost:8001 http://host.name/path

To use it with ab (ApacheBench):

ab -X localhost:8001 http://host.name/path

To use it with Firefox, open the Network settings panel, under Advanced, and set a "Manual Proxy Configuration" after clicking the "Settings..." button. Ensure that "No Proxy for" does not include the host that you are attempting to explore.