__call__() — fastapi Function Reference
Architecture documentation for the __call__() function in oauth2.py from the fastapi codebase.
Entity Profile
Dependency Diagram
graph TD 815c76ad_ef57_2c1a_ca86_4ca22d0bf6d5["__call__()"] 530dd5bc_4096_0b36_b4c7_3b84ace8a699["OAuth2PasswordBearer"] 815c76ad_ef57_2c1a_ca86_4ca22d0bf6d5 -->|defined in| 530dd5bc_4096_0b36_b4c7_3b84ace8a699 8eebc79f_2a8c_2a4d_ce43_d94dc5a2eaf2["make_not_authenticated_error()"] 815c76ad_ef57_2c1a_ca86_4ca22d0bf6d5 -->|calls| 8eebc79f_2a8c_2a4d_ce43_d94dc5a2eaf2 21dea0a2_f30d_d3da_ce48_734fa9836d52["get_authorization_scheme_param()"] 815c76ad_ef57_2c1a_ca86_4ca22d0bf6d5 -->|calls| 21dea0a2_f30d_d3da_ce48_734fa9836d52 style 815c76ad_ef57_2c1a_ca86_4ca22d0bf6d5 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
fastapi/security/oauth2.py lines 536–544
async def __call__(self, request: Request) -> Optional[str]:
authorization = request.headers.get("Authorization")
scheme, param = get_authorization_scheme_param(authorization)
if not authorization or scheme.lower() != "bearer":
if self.auto_error:
raise self.make_not_authenticated_error()
else:
return None
return param
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does __call__() do?
__call__() is a function in the fastapi codebase, defined in fastapi/security/oauth2.py.
Where is __call__() defined?
__call__() is defined in fastapi/security/oauth2.py at line 536.
What does __call__() call?
__call__() calls 2 function(s): get_authorization_scheme_param, make_not_authenticated_error.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free