Commit Graph
4 Commits
Author SHA1 Message Date
sunmh 95ddeae067 feat(auth): add /auth/oidc/start endpoint for direct 302 OIDC login
New endpoint GET /api/v1/auth/oidc/start — unlike /auth/oidc/url which
returns JSON and requires frontend JS to navigate, this endpoint directly
returns a 302 redirect to the OIDC Provider's authorization page. This
enables external platforms (enterprise portals, Nexus, etc.) to give a
single clickable link that triggers the full OIDC authorization code
flow and, when the IdP has an active SSO session, achieves passwordless
login without any frontend involvement.

- backend derives the callback URL from the request origin automatically
  (no caller-supplied redirect_uri needed)
- OIDC nonce cookie is bound identically to /auth/oidc/url (CSRF/replay
  protection)
- registered in the auth middleware public-path whitelist (otherwise
  the global auth middleware returns 401 before routing reaches the
  handler)
- refactored shared nonce-cookie helper out of GetOIDCAuthorizationURL
  for reuse by OIDCStart
2026-08-11 15:41:48 +08:00
wizardchen afd1ef8cf3 fix(invitation): harden auto-accept follow-ups from code review
- Reconcile stale pending invites after auto-accept AddMember
- Adopt invited workspace as home tenant when invitee is tenantless
- Await refreshFromAuthMe on SPA boot; sync auto_accept in hydrateSessionFromToken
- Document capabilities.auto_accept_invitation; extend client SDK and OpenAPI
2026-08-10 15:47:29 +08:00
wizardchen 5494e669bc fix(auth): harden self-service change password after #2591
Address post-merge review: verify old password before policy checks,
reject same-password rotations, mark OIDC-provisioned users in preferences
and hide the self-service form with guidance, map API error details to
i18n, sync docs/api, Swagger, and the Go client SDK.
2026-08-07 15:49:58 +08:00
nullkey c8b2129853 docs(api): restore auth.md and update README/wiki links
Fixes #958.

- 新建 docs/api/auth.md:覆盖 10 个 /auth/* 端点
  register / login / oidc 三件套(config/url/callback)/ refresh /
  validate / logout / me / change-password。
  说明各端点的鉴权方式(无 / refresh_token / Bearer JWT),并对齐
  /auth/oidc/callback 的真实行为(始终 302 跳到 / 并把结果编码进
  URL hash)。
- docs/api/README.md:
  - 增加"最权威参考:Swagger UI"段落,引导读者优先访问
    /swagger/index.html(swagger 由 swag 注解自动从代码生成)。
  - "认证管理"行链接由仅指向 OIDC 流程文档改为同时指向 auth.md
    与 OIDC 流程文档。
  - 新增 "IM 渠道" 行指向 docs/IM集成开发文档.md。
  - 新增 "数据源导入" 行指向 docs/数据源导入开发文档.md。
- docs/wiki/API参考/API文档概览.md:随 api/README.md 的"认证管理"
  行同步更新即可——IM 与数据源在该文件原有的"相关主题"/"反向链接"
  小节已经登记,不在 "API 分类" 表中重复。
2026-05-12 13:16:58 +08:00