HTTP Digest authentication backend.
- class HTTPDigestBackend¶
Authenticate against a user in a digest password file.
This is controlled by the following Django settings:
The local file path on the server containing an HTTP password (
auth_digest_file_locationin the site configuration.
The HTTP realm users will be authenticated into.
auth_digest_realmin the site configuration.
- authenticate(request, username, password, **kwargs)¶
Authenticate a user against the HTTP password file.
This will attempt to authenticate the user against the digest password file. If the username and password are valid, a user will be returned, and added to the database if it doesn’t already exist.
Changed in version 4.0: The
requestargument is now mandatory as the first positional argument, as per requirements in Django.
The authenticated user, or
Noneif the user could not be authenticated for any reason.
- Return type
- get_or_create_user(username, request=None)¶
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.