Skip to content
masterclass Buddy

FastAPI · Class

HTTPBearer

HTTPBearer reads a Bearer token from the Authorization header. Use it as a FastAPI dependency to receive the scheme and token in an HTTPAuthorizationCredentials object.

Last updated

Since
0.122.0

Syntax

HTTPBearer(*, bearerFormat=None, scheme_name=None, description=None, auto_error=True)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • HTTPAuthorizationCredentials
  • OAuth2
  • HTTPBasic
  • HTTPDigest
  • SecurityScopes

Source: Security Tools - FastAPI. Checked 2026-11-03.