HTTPBearer
HTTP Bearer token authentication.
Attributes
| Attribute | Type | Description |
|---|---|---|
| model | HTTPBearerModel | An internal OpenAPI security model instance containing the bearer format and description for documentation generation. |
| scheme_name | `str | None` = HTTPBearer |
| auto_error | bool = True | Determines if the request should be automatically cancelled with an error if the HTTP Bearer token is not provided. |
Constructor
Signature
def HTTPBearer(
bearerFormat: str | None = None,
scheme_name: str | None = None,
description: str | None = None,
auto_error: bool = True
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| bearerFormat | `str | None` = None |
| scheme_name | `str | None` = None |
| description | `str | None` = None |
| auto_error | bool = True | If True, missing or invalid credentials will automatically raise an error. If False, the dependency returns None. |
Signature
def HTTPBearer(
bearerFormat: str | null = None,
scheme_name: str | null = None,
description: str | null = None,
auto_error: bool = True
) - > null
Parameters
| Name | Type | Description |
|---|---|---|
| bearerFormat | `str | null` = None |
| scheme_name | `str | null` = None |
| description | `str | null` = None |
| auto_error | bool = True | Determines if the request should be automatically rejected with an error if the Authorization header is missing or invalid. |