jim800121chen
f3f0cf1c40
fix(auth): promote 換 token 改用 client_secret_post(修 MC 401 invalid_client)
promote 流程的 OAuth client 去 Member Center(OpenIddict)換 service token 時
用 HTTP Basic Auth 送 client 憑證,但 MC 只接受 client_secret_post(憑證放 form
body),導致 MC 回 401 invalid_client → promote 拿不到 token 去 FAA PUT → 對
visionA 回 500。根因由 visionA 端實測定位(交接檔 converter-promote-oauth-handoff.md)。
改 apps/task-scheduler/src/auth/oauthClient.js:
- client_id/client_secret 從 Authorization Basic header 移進 form body(既有 body
上新增、保留 grant_type/scope/audience)
- 移除 Authorization header 與 buildBasicAuthHeader() + _internals export
- 檔頭 design 註解更新為 client_secret_post,避免被改回 Basic
安全約束維持:client_secret 僅進必要 body、絕不進任何 log(既有 "secret never in
log" 測試跑全路徑 grep 驗證、現變成 body 帶 secret 情境的鎖)。
test:oauthClient.test.js 改斷言鎖「headers 無 Authorization + body 含 client_id/
client_secret」防回退。scheduler 全套件 666 pass。
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-24 23:07:10 +08:00
..
2026-05-17 22:47:28 +08:00
2026-06-24 23:07:10 +08:00
2026-05-01 10:55:05 +08:00
2026-05-17 22:47:28 +08:00
2026-05-18 14:02:54 +08:00
2026-06-22 12:43:24 +08:00
2026-06-22 12:43:24 +08:00
2026-05-01 10:55:05 +08:00
2026-05-01 10:55:05 +08:00
2026-05-17 22:47:28 +08:00
2026-05-17 22:47:28 +08:00
2026-05-01 10:55:05 +08:00