Files
SproutGate/docs/oauth-providers/README.md
2026-05-13 12:19:36 +08:00

20 lines
1.2 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# OAuth 2.0 第三方登录分提供商教程Golang
本目录为**通用**接入说明,适用于任意自建后端或 BFF在对应**身份提供商IdP**注册应用,使用 **OAuth 2.0 授权码Authorization Code**`access_token`,再调用各平台用户 API。语言示例统一为 **Go**`golang.org/x/oauth2`)。
| 文档 | 说明 |
|------|------|
| [github.md](github.md) | GitHub OAuth App标准 `github.Endpoint` |
| [gitea.md](gitea.md) | 自建/托管 Gitea 的 OAuth2端点随实例 URL 变化 |
| [linuxdo.md](linuxdo.md) | LINUX DO Connect官方 Connect 端点) |
| [google.md](google.md) | Google 账号,官方 `google.Endpoint` + userinfo |
| [microsoft.md](microsoft.md) | Microsoft / Entra IDv2.0 终结点 + Microsoft Graph |
**共同前提**
- 浏览器中完成授权;`redirect_uri` 必须在 IdP 控制台**逐字登记**(含 `http`/`https`、主机、端口、路径)。
- 换 token 与调用户 API 一般由**你的服务端**发起;请保证服务器出网可达对应域名(企业网络/地区网络可能需代理)。
- 生产环境使用 **HTTPS**`state` 参数防 CSRF勿省略。
以下各篇相互独立,可按需只读其一。