Jump to >


Base support for managing API authentication backends.

These functions allow for fetching the list of available API authentication backend classes, and using them to perform an authentication based on an HTTP request.


Return the list of web API authentication backends.

This defaults to WebAPIBasicAuthBackend, for HTTP Basic Auth, but can be overridden by setting settings.WEB_API_AUTH_BACKENDS to a list of class paths.

Returns:A list of all usable authentication backend classes.
Return type:list

Reset the list of authentication backends.

The list will be recomputed the next time an authentication backend needs to be used.


Check if a login request was made.

If the client specifies a HTTP_AUTHORIZATION header, this will attempt to authenticate using a supported authentication method.

Parameters:request (HttpRequest) – The HTTP request from the client.
Returns:The result of the authentication, if successful, or None otherwise.