Skip to content

Commit 1f92425

Browse files
unatasha8vinckr
authored andcommitted
chore: Integrate Mermaid diagram for device authorization flow
Added a sequence diagram to illustrate the device authorization flow using Mermaid.
1 parent 055a4a3 commit 1f92425

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

docs/oauth2-oidc/device-authorization.mdx

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,38 @@ Here is the high-level overview for the device authorization grant flow:
2424
1. 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

Comments
 (0)