@@ -28,6 +28,35 @@ generated the client ID and secret to configure your `OAuth2Middleware` with at
28
28
Once the authentication is successful, the user will be redirected to the ` redirect_uri ` and the ` request.user ` will
29
29
contain the user information obtained from the IDP.
30
30
31
+ ## Access token
32
+
33
+ When the user is authenticated, the ` request.user ` will contain the user information obtained from the IDP and
34
+ the ` request.auth ` will contain the authentication related information including the access token issued by the IDP. It
35
+ can be used to perform authorized requests to the IDP's API endpoints. Just make sure the token is issued with the
36
+ scopes required for the API endpoint.
37
+
38
+ ::: details ` request.auth.provider.access_token `
39
+
40
+ ``` mermaid
41
+ flowchart TB
42
+ subgraph level2["request (Starlette's Request object)"]
43
+ direction TB
44
+ subgraph level1["auth (Starlette's extended Auth Credentials)"]
45
+ direction TB
46
+ subgraph level0["provider (OAuth2 provider with client's credentials)"]
47
+ direction TB
48
+ token["access_token (Access token for the specified scopes)"]
49
+ end
50
+ end
51
+ end
52
+ style level2 fill:#00948680,color:#f6f6f7,stroke:#3c3c43;
53
+ style level1 fill:#2b75a080,color:#f6f6f7,stroke:#3c3c43;
54
+ style level0 fill:#5c837480,color:#f6f6f7,stroke:#3c3c43;
55
+ style token fill:#44506980,color:#f6f6f7,stroke:#3c3c43;
56
+ ```
57
+
58
+ :::
59
+
31
60
## Claims mapping
32
61
33
62
The ` Claims ` class includes permanent attributes like ` display_name ` , ` identity ` , ` picture ` , and ` email ` . It also allows
@@ -105,7 +134,7 @@ calculating the `identity` attribute.
105
134
:::
106
135
107
136
<style >
108
- .info {
137
+ .info , .details {
109
138
border : 0 ;
110
139
}
111
140
</style >
0 commit comments