Skip to content

[Decision] SSO: may an Okta or Entra app tile start an OIDC sign-in (third-party-initiated login, #32086 item 1)? #32150

Closed

Description

@objectstack-fleet

domain:server#4 · os-support-ai · session_01WGufzi1tLRTEYwYGtbNCyk

Ruled: 6764924025 · letter A (gated third-party-initiated entry onto the vendor's SP-initiated flow) · 2026-11-10T10:24Z
Ruling-ref: 6764924025

Decision card for #32086 item 1. #32086 items 2 and 3 proceed without it (PR-A); item 1 (PR-B) waits on this answer.

一句话问题

企业客户在 Okta 或 Entra ID 的应用门户里点 ObjectOS 的 OIDC 应用图标,今天会落到一个 state_not_found 错误页;要让这一下点击能登录,平台需要新增一个「由 IdP 发起、交给我们走标准登录」的入口,而这个入口不是 @better-auth/sso 自带的。

背景

Governing text

前提(带复查命令)

选项

选项 做什么 客户感受 工作量
A. 建入口 在现有回调路径 GET /sso/callback/:providerId 上,遇到「只带 iss、无 code/state/error」的请求,且该 provider 已登记、allow_idp_initiated 打开、iss 与登记的 issuer 逐字节相等时,转交 vendor 自己的 POST /sign-in/sso 发起标准 SP 登录(新 state、PKCE),302 到 IdP。任何一条不满足就照旧 state_not_found。target_link_uri 只认同源或受信源。 点 Okta/Entra 图标直接进入 ObjectOS;开关默认关,由管理员按 provider 打开。 server 车道 · 1 个 PR(PR-B)约 400–500 行含测试 · 先例 #30967 的 IdP 发起开关
B. 不建,写明不支持 文档写明 OIDC 的 IdP 发起登录不支持,客户在 Okta 用「书签应用」指向登录页,或改用 SAML。 企业客户的 OIDC 图标点了报错,需要绕路或换协议。 devx/文档 · 1 个小 PR
C. 等上游 向 better-auth 提需求,上游支持后再接。 时间不可控,期间同 B。 无先例,时程未知

业务含义直译

  • A:像门禁接受「公司前台打电话来说这人是我们的人」,但我们仍要求访客自己刷卡(走完整的标准登录),前台的电话只是让他直接走到刷卡机前。
  • B:前台的电话一律不接,访客得自己从大门绕进来。
  • C:等门禁厂商出新版本再说。

四维分析

  • 项目长远合理性(≥50%):两年后企业 SSO 的平台样子是:SAML 和 OIDC 都能从 IdP 门户一键进入,这是 Okta/Entra 集成目录的基本要求(Salesforce、Slack 作为 RP 都支持 initiate_login_uri)。A 只加一个翻译入口,登录的每一步安全机制(state、PKCE、换码、验签、建会话)仍是 vendor 的;它与裁决 A「不自建登录机制」的精神一致,只是入口本身是我们的。B/C 让 OIDC 永远比 SAML 少一项能力,而 SAML 的 IdP 发起本身是协议上更弱的那种(维护者在裁决 A 里已接受这个风险)。
  • 实际业务拉动:有。cloud#3666 是 cloud/ROADMAP.md 第 1 档「外部 IdP SSO 端到端验证」,真实 Okta 组织实测撞上;Entra My Apps 同样。
  • 防 AI 犯错:A 的入口是闭合判据(四条全满足才放行,其余原样拒绝并记一行 warn),没有宽容回退;出错时用户看到的是今天的 state_not_found,不会静默登录错人。
  • 创业阶段不扩散:A 约 400–500 行,复用现有开关,不加新配置键;B 最省,但把一个已裁定要做的能力(裁决 A 写明 SAML 和 OIDC 都有开关)留成半截。

os-decision-facets
① 长远:A 补齐裁决 A 已承诺的 OIDC 半边,不增新契约键;B/C 留一个永久特例(OIDC 少一项)。
② 拉动:路线图第 1 档客户实测撞上(cloud#3666,Okta + Entra)。
③ 防错:闭合四条判据,失败即今天的拒绝,不铸会话;无静默放行。
④ 不扩散:A 复用现有开关、无新键,约 400–500 行;B 最小但留半截能力。

推荐

A。 只看①选 A;②③④ 是否翻转:否。置信缺口:入口可被任意网站上的链接触发(GET),对已开启开关的 provider 会启动一次 SSO 流程;但它能到达的东西不超过今天任何人都能调用的 POST /sign-in/sso,而且最终登录仍需用户在 IdP 侧通过认证。

不取 B:OIDC 客户无法从门户进入,裁决 A 的 OIDC 开关形同虚设。不取 C:时程不可控,期间等同 B。

安全面说明(人工地板)

本项改变未登录请求能到达的东西:一种新的未登录 GET 形状会得到 302 到 IdP、一个 state cookie 和一条 auth-state 记录(今天得到 state_not_found)。按 pm-dispatch,认证流的放宽是人工地板,席位不代裁。

裁后执行

相关

#32086(item 1)· #30967(裁决 A)· cloud#3666 · step-0 读数 /mnt/project-files/issue-32086/step0.md

Activity

  1. added
    priority:p1
    needs-user-decision
    domain:server
    on Nov 10, 2026
  2. os-support-ai commented on Nov 10, 2026

    @os-support-ai
    Collaborator

    Ruling: build the gated third-party-initiated entry onto the vendor's own SP-initiated flow · letter A · maintainer chose "A 建受控入口(推荐)" on the decision card 2026-11-10T10:24Z

    What A binds (#32086 item 1, PR-B):

    1. On the existing GET /sso/callback/:providerId, a request carrying iss and no code, state or error is handed to the vendor's own POST /sign-in/sso (fresh state, PKCE) and answered with a 302 to the IdP only when all four hold: the provider is registered; its allow_idp_initiated toggle is on (the per-provider toggle from plugin-auth SSO: expose the operator knobs Enterprise SSO needs — IdP-initiated sign-in, IdP group to role / permission set, and refusing unknown users instead of JIT #30967 ruling A, default off, every change audited); iss equals the registered issuer byte for byte; target_link_uri is absent, same-origin, or a trusted origin. Any miss keeps today's state_not_found and writes one warn line. No permissive fallback.
    2. The entry mints nothing: no session cookie, no sys_session row. A session is created only by the vendor after the IdP returns code with a matching state, the code exchange succeeds and the ID token verifies. This stays inside plugin-auth SSO: expose the operator knobs Enterprise SSO needs — IdP-initiated sign-in, IdP group to role / permission set, and refusing unknown users instead of JIT #30967's "no sign-in mechanism of our own".
    3. Pins the PR carries: the entry sets no session cookie and writes no sys_session; a later callback with a foreign or missing state is still refused; the four controls (toggle off, iss off by one character, a SAML provider, an untrusted target_link_uri) all keep today's behaviour.
    4. No new configuration key. Metadata-protocol: none. Security floor: a relaxation of what an unauthenticated GET reaches, so the seat re-reviews at the contract-review tier before landing.

    Reader who acts: the domain:server seat (seat 4) orders PR-B on the #32086 card thread per the step-0 design (Fixes #32086). Labels are the seat's stroke.


    Generated by Claude Code

  3. objectstack-fleet commented on Nov 10, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:server#4 · os-support-ai · session_01WGufzi1tLRTEYwYGtbNCyk

    Ruled A (6764924025, maintainer 2026-11-10). needs-user-decision removed; closed as completed. Executed on #32086 as PR-B (Fixes #32086) by the seat 4 card thread, contract-review tier re-review before landing.

  4. removed
    needs-user-decision
    on Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:serverpriority:p1

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions