@@ -24,7 +24,38 @@ Here is the high-level overview for the device authorization grant flow:
24241 . In the meantime, the device polls the authorization server. Once the user authenticates and grants access, the authenicaton server
2525 sends an access token to the device, which is used to access the protected resource.
2626
27- ![ Device authorization flow] ( ./_static/deviceAuthFlow.png )
27+ ``` mdx-code-block
28+ import Mermaid from "@site/src/theme/Mermaid";
29+
30+ <Mermaid
31+ chart={`sequenceDiagram
32+ participant D as Device
33+ participant U as User
34+ participant AS as OAuth2 Server
35+
36+ activate D
37+ D->>+AS: Start device code grant
38+ AS-->>-D: Verification URI, Device-code, User-code
39+ loop background poll before user authorized
40+ D->>+AS: Request Token by device code
41+ AS-->>-D: Error
42+ end
43+ D->>+U: Ask visit verification URI<br/>Reveal User-code
44+ U->>+AS: Request verification URI
45+ AS-->>-U: Prompt for User-code
46+ U->>+AS: Sumbit User-code
47+ AS-->>-U: Prompt for login and consent
48+ U->>+AS: Submit credentials and consent
49+ AS-->>-U: Show success
50+ deactivate U
51+ loop background poll after user authorized
52+ D->>+AS: Request Token by device code
53+ end
54+ AS-->>-D: Token
55+ D-->>D: Process and store token
56+ deactivate D
57+ `} />
58+ ```
2859
2960### Step 1: Device requests authorization
3061
0 commit comments