Jump to >

reviewboard.accounts.backends.http_digest

HTTP Digest authentication backend.

class HTTPDigestBackend[source]

Bases: reviewboard.accounts.backends.base.BaseAuthBackend

Authenticate against a user in a digest password file.

This is controlled by the following Django settings:

DIGEST_FILE_LOCATION:

The local file path on the server containing an HTTP password (htpasswd) file.

This is auth_digest_file_location in the site configuration.

DIGEST_REALM:

The HTTP realm users will be authenticated into.

This is auth_digest_realm in the site configuration.

backend_id = u'digest'[source]
name = _(u'HTTP Digest Authentication')[source]
settings_form[source]

alias of reviewboard.accounts.forms.auth.HTTPBasicSettingsForm

login_instructions = _(u'Use your standard username and password.')[source]
authenticate(username, password, **kwargs)[source]

Authenticate a user against the HTTP password file.

Parameters:
  • username (unicode) – The username to authenticate.
  • password (unicode) – The user’s password.
  • **kwargs (dict, unused) – Additional keyword arguments passed by the caller.
Returns:

The authenticated user. If authentication fails for any reason, this will return None.

Return type:

django.contrib.auth.models.User

get_or_create_user(username, request=None)[source]

Return an existing user or create one if it doesn’t exist.

This does not authenticate the user.

If the user does not exist in the database, but does in the HTTP password file, its information will be stored in the database for later lookup.

Parameters:
  • username (unicode) – The name of the user to look up or create.
  • request (django.http.HttpRequest, unused) – The HTTP request from the client. This is unused.
Returns:

The resulting user, or None if one could not be found.

Return type:

django.contrib.auth.models.User