You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
""" Factory method, returning an AuthenticationMiddleware
75
83
Intentionally not named with lower snake case convention as this is a factory method returning a class. Should feel like a class.
76
84
77
85
Args:
78
86
app (FastAPI): The FastAPI instance the middleware should be applied to. The `add_middleware` function of FastAPI adds the app as first argument by default.
79
-
verify_authorization_header (callable): A function handle that returns a list of scopes and a BaseUser
87
+
verify_authorization_header (Callable[[str], Tuple[List[str], BaseUser]]): A function handle that returns a list of scopes and a BaseUser
88
+
auth_error_handler (Callable[[Request, Exception], JSONResponse]): Optional error handler for creating responses when an exception was raised in verify_authorization_header
0 commit comments