feat(auth): 添加 Linux DO Connect OAuth 登录支持
- 新增 Linux DO OAuth 配置项和环境变量支持 - 实现 OAuth 授权流程和回调处理 - 前端添加 Linux DO 登录按钮和回调页面 - 支持通过 Linux DO 账号注册/登录 - 添加相关国际化文本 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -234,6 +234,31 @@ jwt:
|
||||
# 令牌过期时间(小时,最大 24)
|
||||
expire_hour: 24
|
||||
|
||||
# =============================================================================
|
||||
# LinuxDo Connect OAuth Login (SSO)
|
||||
# LinuxDo Connect OAuth 登录(用于 Sub2API 用户登录)
|
||||
# =============================================================================
|
||||
linuxdo_connect:
|
||||
enabled: false
|
||||
client_id: ""
|
||||
client_secret: ""
|
||||
authorize_url: "https://connect.linux.do/oauth2/authorize"
|
||||
token_url: "https://connect.linux.do/oauth2/token"
|
||||
userinfo_url: "https://connect.linux.do/api/user"
|
||||
scopes: "user"
|
||||
# 示例: "https://your-domain.com/api/v1/auth/oauth/linuxdo/callback"
|
||||
redirect_url: ""
|
||||
# 安全提示:
|
||||
# - 建议使用同源相对路径(以 / 开头),避免把 token 重定向到意外的第三方域名
|
||||
# - 该地址不应包含 #fragment(本实现使用 URL fragment 传递 access_token)
|
||||
frontend_redirect_url: "/auth/linuxdo/callback"
|
||||
token_auth_method: "client_secret_post" # client_secret_post | client_secret_basic | none
|
||||
# 注意:当 token_auth_method=none(public client)时,必须启用 PKCE
|
||||
use_pkce: false
|
||||
userinfo_email_path: ""
|
||||
userinfo_id_path: ""
|
||||
userinfo_username_path: ""
|
||||
|
||||
# =============================================================================
|
||||
# Default Settings
|
||||
# 默认设置
|
||||
|
||||
Reference in New Issue
Block a user