djblets.webapi.auth.backends.basic¶
An authentication backend for HTTP Basic Auth.
- class WebAPIBasicAuthBackend¶
Bases:
WebAPIAuthBackend
Handles HTTP Basic Authentication for the web API.
- www_auth_scheme: Optional[str] = 'Basic realm="Web API"'¶
The auth scheme used in the
WWW-Authenticate
header.- Type:
- get_credentials(request: HttpRequest) Optional[Union[Tuple[bool, Optional[str], Optional[Dict[str, str]]], Dict[str, Any]]] ¶
Return credentials provided in the request.
This returns a dictionary of all credentials necessary for this auth backend.
If an Authorization header is provided, the result will be the parsed username and password.
- Parameters:
request (
django.http.HttpRequest
) – The HTTP request from the client.- Returns:
A dictionary of credential information containing:
- Keys:
This will be
None
if Authorization is not passed or could not be parsed as a HTTP Basic Auth header.- Return type:
- __annotations__ = {'www_auth_scheme': 'Optional[str]'}¶