###Resources (some are just "How OAuth works notes aka w/ Twitter", some are "django-piston specific")
-
http://blog.carduner.net/2010/01/26/django-piston-and-oauth/
-
"Where to access the OAuth Consumer key and Consumer secret": http://twitter.com/apps
-
"How to access Twitter User data (profile image, etc)": https://twitter.com/account/verify_credentials.json
-
"OAuth client + Django example (is README)": http://github.com/simplegeo/python-oauth2
-
http://mojodna.net/2009/05/20/an-idiots-guide-to-oauth-10a.html
-
http://netsmith.blogspot.com/2010/02/how-i-built-feedertweeter-in-less-than.html
-
http://code.google.com/p/oauth-python-twitter/source/browse/trunk/oauthtwitter.py
-
"Twisted oauth-proxy":http://github.com/mojodna/oauth-proxy
-
"Obtaining a token, Use the token":http://api.bitbucket.org/1.0/doc/auth/
-
http://mojodna.net/2009/08/21/exploring-oauth-protected-apis.html
###Preliminary steps and Code (django-piston "blogpost" example + 'piston.authentication.OAuthAuthentication'):
"You are unauthenticated. (API protected by OAuth)." In browser:
http://localhost:8000/api/posts.json
Add/Auth new creds/token "by hand":
http://localhost:8000/admin/piston/token/
Authorizing Token (logged in as Admin):
http://localhost:8000/api/oauth/authorize/?oauth_token=3Szw3AU5bkMV6QTVnR
###Edited file for Django 'blogserver' Example from django-piston
vim blogserver/piston/templates/oauth/challenge.html
vim blogserver/piston/templates/oauth/authorize_token.html
vim blogserver/piston/templates/api/mails/consumer_accepted.txt
vim blogserver/settings.py
vim oauth_client.py
vim python-oauth2/oauth2/__init__.py
###Running Client
$ python oauth_client.py
$ curl -u testuser:foobarr "http://127.0.0.1:8000/api/posts.json" -F "title=test" # No OAuth
$ curl -u testuser:foobar "http://127.0.0.1:8000/api/posts.json" -F "title=test" -F "content=blah" # using OAuth Twisted proxy
###OAuth Twisted Proxy
pip -E piston_env/ install twisted
cd piston_env/
git clone git://github.com/mojodna/oauth-proxy.git
source bin/activate
twistd -n oauth_proxy --consumer-key testkey --consumer-secret testsecret --token 3Szw3AU5bkMV6QTVnR --token-secret gNyCyxF4HjPUTs5pMBzCnSduRpGJKCxA