djblets.webapi.auth.backends.basic¶
An authentication backend for HTTP Basic Auth.
- class WebAPIBasicAuthBackend[source]¶
Bases:
WebAPIAuthBackendHandles HTTP Basic Authentication for the web API.
- www_auth_scheme: ClassVar[str | None] = 'Basic realm="Web API"'[source]¶
The auth scheme used in the
WWW-Authenticateheader.- Type:
- get_credentials(request: HttpRequest) tuple[bool, str | None, dict[str, str] | None] | dict[str, Any] | None[source]¶
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
Noneif Authorization is not passed or could not be parsed as a HTTP Basic Auth header.- Return type:
- __annotations__ = {'SENSITIVE_CREDENTIALS_RE': 'ClassVar[re.Pattern[str]]', 'www_auth_scheme': 'ClassVar[str | None]'}¶