Skip to content

Commit a4989b8

Browse files
authored
Update oauth2.md
1 parent 04bd2cc commit a4989b8

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

docs/oauth2.md

+31-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,37 @@ LoxiLB REST API now supports OAuth2 token-based authentication feature to enhanc
66

77
Previously, the LoxiLB API could be used with user/password based authentication or non-authentication. However, with this update, Oauth2 authentication has been introduced. The new authentication method requires users to go through a Oauth2 login process(currently google+ and github supports) to obtain a token, which must be used for API requests. This feature can be enabled using an option(`--oauth2, --oauth2provider=google,github`) and environment variables (`OAUTH2_GOOGLE_CLIENT_ID, OAUTH2_GOOGLE_CLIENT_SECRET, OAUTH2_GOOGLE_REDIRECT_URL, OAUTH2_GITHUB_CLIENT_ID, OAUTH2_GITHUB_CLIENT_SECRET, OAUTH2_GITHUB_REDIRECT_URL`) for Oauth2 authentication, and if not activated, the API can be used as before.
88

9-
OAuth2 authentication-based LoxiLB does not need a separate database like the token-based approach. It seamlessly utilizes OAuth2 authentication tokens.
9+
OAuth2 authentication-based LoxiLB does not need a separate database like the token-based approach. It seamlessly utilizes OAuth2 authentication tokens. The following is a sequence diagram for applications using OAuth2 -
10+
11+
```
12+
+-------------+ +-----------------+ +--------------+
13+
| User | | Client App | | Auth Server |
14+
+-------------+ +-----------------+ +--------------+
15+
| | |
16+
| 1. Request Access | |
17+
|--------------------->| |
18+
| | 2. Redirect to Auth |
19+
| |-----------------------> |
20+
| | |
21+
| | 3. User Logs In |
22+
| |<------------------------|
23+
| | |
24+
| | 4. Auth Code Issued |
25+
| |<------------------------|
26+
| | |
27+
| | 5. Exchange Code for Token |
28+
| |-----------------------> |
29+
| | |
30+
| | 6. Access Token Issued |
31+
| |<------------------------|
32+
| | |
33+
| | 7. Request Resource |
34+
| |-----------------------> | (Resource Server)
35+
| | |
36+
| | 8. Resource Granted |
37+
| |<------------------------|
38+
```
39+
```
1040
1141
### Key Changes
1242

0 commit comments

Comments
 (0)