MCPcopy Index your code
hub / github.com/fastapi/fastapi / HTTPAuthorizationCredentials

Class HTTPAuthorizationCredentials

fastapi/security/http.py:29–66  ·  view source on GitHub ↗

The HTTP authorization credentials in the result of using `HTTPBearer` or `HTTPDigest` in a dependency. The HTTP authorization header value is split by the first space. The first part is the `scheme`, the second part is the `credentials`. For example, in an HTTP Bearer token

Source from the content-addressed store, hash-verified

27
28
29class HTTPAuthorizationCredentials(BaseModel):
30 """
31 The HTTP authorization credentials in the result of using `HTTPBearer` or
32 `HTTPDigest` in a dependency.
33
34 The HTTP authorization header value is split by the first space.
35
36 The first part is the `scheme`, the second part is the `credentials`.
37
38 For example, in an HTTP Bearer token scheme, the client will send a header
39 like:
40
41 ```
42 Authorization: Bearer deadbeef12346
43 ```
44
45 In this case:
46
47 * `scheme` will have the value `"Bearer"`
48 * `credentials` will have the value `"deadbeef12346"`
49 """
50
51 scheme: Annotated[
52 str,
53 Doc(
54 """
55 The HTTP authorization scheme extracted from the header value.
56 """
57 ),
58 ]
59 credentials: Annotated[
60 str,
61 Doc(
62 """
63 The HTTP authorization credentials extracted from the header value.
64 """
65 ),
66 ]
67
68
69class HTTPBase(SecurityBase):

Callers 3

__call__Method · 0.85
__call__Method · 0.85
__call__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…