File tree Expand file tree Collapse file tree 4 files changed +54
-19
lines changed Expand file tree Collapse file tree 4 files changed +54
-19
lines changed Original file line number Diff line number Diff line change 1
- TODO...
1
+ !!! note
2
+
3
+ - `开发者` 指使用JustAuth的开发者
4
+ - `第三方` 指开发者对接的第三方客户端,比如:Google、GitHub、Gitee 等
5
+ - `用户` 指最终服务的真实用户
6
+
7
+ - ==client_id== 客户端身份标识符(应用id),一般在申请完 ` OAuth ` 应用后,由第三方客户端颁发
8
+ - ==client_secret== 客户端密钥,一般在申请完 ` OAuth ` 应用后,由第三方客户端颁发
9
+ - ==redirect_uri== 开发者项目中真实有效的 API 地址。用户在确认第三方客户端授权(登录)后,第三方客户端会自动重定向到该地址,并携带
10
+ code 等参数
11
+ - ==state== 用于在请求和回调之间维护状态,主要用于防止跨站请求伪造(CSRF)攻击
12
+ - ==source== 支持的第三方客户端,比如:GitHub、LinuxDo 等
13
+ - ==sid== 第三方客户端的用户 ID。以下是关于各平台的 sid 存储逻辑:
14
+
15
+ !!! warning
16
+
17
+ 建议通过 `sid` + `source` 的方式确定唯一用户,这样可以解决用户身份归属的问题。因为 单个用户ID
18
+ 在某一平台中是唯一的,但不能保证在所有平台中都是唯一的。
19
+
20
+ ## 参考资料
21
+
22
+ 关于 OAuth2 相关的内容、原理可以自行参阅以下资料:
23
+
24
+ - [ The OAuth 2.0 Authorization Framework] ( https://tools.ietf.org/html/rfc6749 )
25
+ - [ OAuth 2.0] ( https://oauth.net/2/ )
Original file line number Diff line number Diff line change 7
7
8
8
## 安装
9
9
10
- === ":simple-piped : pip"
10
+ === ":simple-python : pip"
11
11
12
12
```sh
13
13
pip install fastapi-oauth20
14
14
```
15
15
16
- === ":simple-pdm: pdm "
16
+ === ":simple-uv: uv "
17
17
18
18
```sh
19
- pdm add fastapi-oauth20
19
+ uv add fastapi-oauth20
20
20
```
21
21
22
- === ":simple-uv: uv "
22
+ === ":simple-pdm: pdm "
23
23
24
24
```sh
25
- uv add fastapi-oauth20
25
+ pdm add fastapi-oauth20
26
26
```
Original file line number Diff line number Diff line change 1
- 如果你有更多需求,请在仓库内创建 Issues,我们将尽力完成所有目标
1
+ !!! tip
2
2
3
- - [x] 表示已集成
4
- - [ ] 表示待集成
3
+ 如果你有更多需求,请在仓库内创建 Issues,我们将尽力完成所有目标
4
+
5
+ !!! danger ""
6
+
7
+ 对于强制要求【实名 + 人脸认证】的平台,集成变得困难,所以它们不会很快到来
8
+
9
+ - [x] 表示{++已集成++}
10
+ - [ ] 表示{--未集成--}
5
11
6
12
---
7
13
Original file line number Diff line number Diff line change @@ -6,14 +6,13 @@ site_author: Wu Clan
6
6
repo_name : fastapi-oauth20
7
7
repo_url : https://github.com/wu-clan/fastapi-oauth20
8
8
nav :
9
- - Home :
10
- - 主页 : index.md
11
- - 集成状态 : integration.md
12
- - Install : install.md
13
- - Explanation : explanation.md
14
- - Usage : usage.md
15
- - Advanced : advanced.md
16
- - Changelog : changelog.md
9
+ - 主页 : index.md
10
+ - 集成状态 : integration.md
11
+ - 安装 : install.md
12
+ - 名词解释 : explanation.md
13
+ - 用法 : usage.md
14
+ - 高级用法 : advanced.md
15
+ - 变更日志 : changelog.md
17
16
theme :
18
17
name : material
19
18
font :
42
41
- navigation.instant.progress
43
42
- navigation.path
44
43
- navigation.tracking
45
- - navigation.tabs
46
44
- navigation.tabs.sticky
47
45
- navigation.top
48
46
- navigation.footer
@@ -58,9 +56,16 @@ markdown_extensions:
58
56
- attr_list
59
57
- def_list
60
58
- md_in_html
61
- - pymdownx.snippets
59
+ - admonition
60
+ - pymdownx.details
62
61
- pymdownx.superfences
62
+ - pymdownx.snippets
63
63
- pymdownx.inlinehilite
64
+ - pymdownx.critic
65
+ - pymdownx.caret
66
+ - pymdownx.keys
67
+ - pymdownx.mark
68
+ - pymdownx.tilde
64
69
- pymdownx.highlight :
65
70
anchor_linenums : true
66
71
line_spans : __span
You can’t perform that action at this time.
0 commit comments