Support OAuth allowed domains for self-hosted installs
维护者通常 1 天内回复
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 38/100
- Issue 类型
- 功能
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- typescript
调研方向
首先定位 OAuth 回调和配置入口点,然后确定当前如何处理已验证的电子邮件域、Google hosted-domain claims 和 ALLOW_REGISTRATION。在实现之前解决通用配置与提供商特定配置,以及通用注册行为与提供商特定注册行为之间的问题;完成的标准是匹配的用户可以按指定方式进行身份验证,而不匹配的用户会被拒绝,并且在没有 allowlist 时现有行为保持不变。
由索引模型根据 Issue 内容生成。
描述
Hi! Opening this as an issue first before doing another PR/rebase, as suggested in #428.
Use case
For self-hosted OpenPanel deployments, it would be useful to enable OAuth login while restricting access to members of a company domain / Google Workspace domain.
A common setup is:
- OpenPanel is self-hosted and reachable on a public URL
- Google OAuth is enabled for convenience
- public registration is disabled with
ALLOW_REGISTRATION=false - only users from an approved company domain should be able to sign in or create accounts through OAuth
At the moment, enabling OAuth does not provide a built-in domain allowlist, so operators need to rely on provider-side configuration or external controls. For Google OAuth, Workspace/internal setup is not always enough by itself for self-hosted deployments, and app-side enforcement would make the behavior clearer.
Proposed behavior
Add optional OAuth domain allowlisting:
- when no allowlist is configured, keep the current behavior unchanged
- when configured, reject OAuth callback users whose verified email domain is not allowed
- for Google, validate
email_verified, the email domain, and ideally the Google ID token hosted-domain claim (hd) for Workspace accounts - matching-domain OAuth users can sign in
- matching-domain OAuth users can sign up even when
ALLOW_REGISTRATION=false - non-matching users cannot sign in or create accounts through OAuth
Possible configuration
Generic option:
OAUTH_ALLOWED_DOMAINS=example.com,example.org
Optionally, provider-specific configuration could also be supported:
GOOGLE_ALLOWED_DOMAINS=example.com
Questions before implementation
- Would you prefer a single generic
OAUTH_ALLOWED_DOMAINSoption, provider-specific options likeGOOGLE_ALLOWED_DOMAINS, or both? - For Google, should a configured domain allowlist require the
hdclaim to match, or should verified email domain be enough? - Should matching-domain OAuth be allowed to create users when
ALLOW_REGISTRATION=false, or should the allowlist only restrict login for users that already exist?
Happy to open a fresh PR if this direction makes sense.
- 主要语言
- TypeScript
- 星标
- 7.1k
- 派生
- 510
- 平均合并
- 7 天 2 小时
- 30 天内合并 PR
- 7
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 没有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
Openpanel-dev/openpanel 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 88/100
Openpanel-dev/openpanel#532 ·
维护者通常 1 天内回复
-
Period comparison badge shows wrong percentage for decreases (100 → 50 shows ↓100%)可能已有人在做 @sarmah-rup 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
Openpanel-dev/openpanel#526 ·
维护者通常 1 天内回复
-
Self-hosted missing op1-replay.js可能已有人在做 @houstona 于 9 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 84/100
Openpanel-dev/openpanel#512 · 1 条评论 ·
维护者通常 1 天内回复
-
login page needs refinement可能已有人在做 @anandghegde 于 24 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 68/100
Openpanel-dev/openpanel#495 ·
维护者通常 1 天内回复
-
难度 3/5 1-2 天 新手友好度 68/100
Openpanel-dev/openpanel#528 ·
维护者通常 1 天内回复
查看 Openpanel-dev/openpanel 的全部 Issue
相似的 Issue
-
Tenant
难度 2/5 1-3 小时 新手友好度 66/100
MTES-MCT/Dossier-Facile-Frontend#2061 ·
维护者通常 1 天内回复
-
area:frontend
难度 2/5 1-3 小时 新手友好度 65/100
interledger/publisher-tools#905 ·
维护者通常 1 天内回复
-
approved check:passed streams:add
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
DB-plane provider_chat_options.* is accepted by config set but never merged into the loaded config未关闭
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
area:web
难度 2/5 1-3 小时 新手友好度 82/100
praetorianer777/GoTome#178 ·
维护者通常 1 天内回复