Skip to content

Commit 8e96b70

Browse files
committed
oauth diagram
1 parent 8c058d8 commit 8e96b70

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
```mermaid
2+
sequenceDiagram
3+
participant U as User
4+
participant F as Fern Docs
5+
participant A as OAuth2 Provider
6+
7+
U->>F: Visit restricted page
8+
F->>F: Check fern_token cookie
9+
10+
alt Cookie exists
11+
F->>F: Decode cookie
12+
F->>F: Verify authentication credentials
13+
Note over F: Attempt to refresh the token, if expired
14+
15+
alt User is properly authenticated
16+
F->>U: Show restricted content
17+
else User is not properly authenticated
18+
F->>U: User is shown a 404 page
19+
end
20+
else No cookie
21+
F->>A: Redirect to `/authenticate` endpoint
22+
A->>U: User authenticates
23+
U->>F: Authorization code is returned
24+
F->>A: Redirect to `/token` endpoint
25+
A->>A: Validate token request
26+
A->>F: Send authenticated access token
27+
F->>F: Set fern_token cookie
28+
F->>F: Verify authentication credentials
29+
F->>U: Show restricted content
30+
end
31+
```
32+

0 commit comments

Comments
 (0)