接入说明
面向开发者说明认证接口、会话模型与页面路由兼容关系。
接入说明
StarWork Web 端复用现有 auth-service 认证能力,同时新增浏览器会话支持。
兼容保留的接口
GET /loginGET /auth/providersGET /auth/:provider/startGET /auth/:provider/callbackPOST /auth/session/exchangePOST /auth/session/transferGET /auth/session/handoffGET /auth/session/mePOST /auth/logout
新增的 Web 语义
GET /auth/:provider/start 支持可选 query:
txt
client=desktop|web
returnTo=/POST /auth/session/exchange 支持:
json
{ "grant": "<code>", "channel": "desktop|web" }POST /auth/session/transfer 支持:
json
{ "returnTo": "/" }回调策略
- 桌面端:保持 deep link 返回桌面应用
- Web:在浏览器中写入
starwork_web_sessioncookie,并跳回returnTo
会话家族
每次首次登录都会生成一个 session_family_id,桌面端与 Web 通过 transfer / bootstrap 建立的新会话会复用同一个 family。
这意味着:
- 登录一次,多端可通行
- 任一端调用
POST /auth/logout,同一 family 下的 desktop / web 会话会一起失效