Digest authentication for Piston

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
from django_digest import HttpDigestAuthenticator

class HttpDigestAuthentication(object):
        
    def __init__(self):
        self._authenticator = HttpDigestAuthenticator()

    def is_authenticated(self, request):
        return self._authenticator.authenticate(request)
            
    def challenge(self):
        return self._authenticator.build_challenge_response()

More like this

  1. Support alternative authentication mechanisms with Piston by erikwright 4 years, 3 months ago
  2. Django authentication for django-piston by chronos 3 years, 7 months ago
  3. django-tokenapi authentication for django-piston by yurtaev 2 years, 5 months ago
  4. django piston use origin django auth by lettoo 2 years, 2 months ago
  5. TwitterBackend by hameedullah 4 years, 12 months ago

Comments

paule (on January 19, 2010):

Thanks a lot, could you please provide a short explanation how to integrate it? Thank you!

#

paule (on January 20, 2010):

I tried it this way now:

class P2f_HttpDigestAuthentication(object):
    def __init__(self):
        self._authenticator = HttpDigestAuthenticator()

    def is_authenticated(self, request):
        return self._authenticator.authenticate(request)

    def challenge(self):
        return self._authenticator.build_challenge_response()

auth = P2f_HttpDigestAuthentication()

urlpatterns = patterns('myapp.api',
    url(r'^(?P<emitter_format>.+)/test/$',     Resource(TestHandler, authentication=auth)),
…

but no authentication is required. Any ideas?

#

paule (on January 20, 2010):

Works now - I had the credentials in the cache...

#

dumb906 (on May 12, 2012):

works

#

(Forgotten your password?)