Skip to main content

HTTPBearer

HTTP Bearer token authentication.

Attributes

AttributeTypeDescription
modelHTTPBearerModelAn internal OpenAPI security model instance containing the bearer format and description for documentation generation.
scheme_name`strNone` = HTTPBearer
auto_errorbool = TrueDetermines 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

NameTypeDescription
bearerFormat`strNone` = None
scheme_name`strNone` = None
description`strNone` = None
auto_errorbool = TrueIf 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

NameTypeDescription
bearerFormat`strnull` = None
scheme_name`strnull` = None
description`strnull` = None
auto_errorbool = TrueDetermines if the request should be automatically rejected with an error if the Authorization header is missing or invalid.