Skip to content

gregbayer/django-piston-two-legged-oauth

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 

Repository files navigation

About

django-piston-two-legged-oauth is a simple 2-legged OAuth connector for Django Piston.

Dependencies:

Adapted from example:

Related discussions:

Example

# urls.py

from api.authentication import TwoLeggedOAuthAuthentication
from api.handlers import DoSomethingHandler

two_legged_oauth = TwoLeggedOAuthAuthentication(realm='API')

class CsrfExemptResource( Resource ):
    def __init__( self, handler, authentication = None ):
        super( CsrfExemptResource, self ).__init__( handler, authentication )
        self.csrf_exempt = getattr( self.handler, 'csrf_exempt', True )

def TwoLeggedOAuthProtectedResource(handler):
    return CsrfExemptResource(handler=handler, authentication=two_legged_oauth)

do_something = TwoLeggedOAuthProtectedResource( DoSomethingHandler )

urlpatterns = patterns('',
    url( r'^do_something', do_something, name='do_something'),
)

About

Simple 2-legged OAuth connector for django piston.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages