Coder Social home page Coder Social logo

django-digest's Introduction

Visit http://bitbucket.org/akoha/django-digest/ for further information.

This library facilitates the implementation of HTTP Digest Authentication for Django projects.

It supplies a middleware (HttpDigestMiddleware) that may installed to protect access to all
URLs, a decorator (@httpdigest) that may be applied to selected view functions, and a simple
class (HttpDigestAuthenticator) that can be used to implement custom authentication scenarios.

The following settings may be defined in your Django settings file. Sensible defaults are
provided as well.

DIGEST_ENFORCE_NONCE_COUNT (True):
    Whether the nonce-count supplied by the client is required to increase with each request.
DIGEST_REALM (DJANGO):
    The realm value to use.
DIGEST_NONCE_TIMEOUT_IN_SECONDS (5*60):
    The maximum time between the generation of a nonce and the initiation of a session with
    that nonce.
DIGEST_REQUIRE_AUTHENTICATION (False):
    If True, the middleware will require all requests to be authenticated. Otherwise, the
    middleware only performs authentication after intercepting a 401/403 response from the view.
DIGEST_ACCOUNT_BACKEND ('django_digest.backend.db.AccountStorage'):
    A class responsible for managing access to users and their credentials. Must implement:
      * get_partial_digest(self, username):
            Returns H(username:realm:password) or None
      * get_user(self, username):
            Returns an object representing the specified user, or None. This object will be
	    stored in request.user upon successful authentication.
DIGEST_NONCE_BACKEND ('django_digest.backend.db.NonceStorage')
    A class responsible for managing session information. Must implement:
      * update_existing_nonce(self, user, nonce, nonce_count):
          Called upon successful authentication of the specified user (as returned from the
	  account backend's get_user method) with the specified nonce and nonce_count.
	  If the nonce-count is not being enforced, nonce_count will be None. This method should
	  return True if the nonce is already associated with the specifed user (only) and the
	  nonce_count is greater than all previous nonce-counts for the same nonce (or is None)
	  or False otherwise.
      * store_nonce(self, user, nonce, nonce_count):
          Called upon successful authentication of the specified user (as returned from the
	  account backend's get_user method) if update_existing_nonce returns False. If the
	  nonce-count is not being enforced, nonce_count will be None. This method should return
	  True if the nonce is not already associated with any user.

django-digest's People

Contributors

sfllaw avatar trey0 avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.