Documentation
README
PinMe Worker Auth API Integration
Guides how to call PinMe platform's Identity Platform auth proxy APIs in a PinMe Worker (TypeScript).
Environment Variables
// backend/src/worker.ts
export interface Env {
DB: D1Database;
API_KEY: string; // 项目 API Key — 用于所有 auth 接口认证
PROJECT_NAME: string; // 项目名 — 所有 auth 接口必须同时传递
BASE_URL?: string; // 可选,默认 https://pinme.cloud
}
API_KEY和PROJECT_NAME是所有 auth 接口的必填凭证,缺一不可。
认证方式(所有接口通用)
| 参数 | 传递方式 | 必填 | 说明 |
|---|---|---|---|
X-API-Key |
请求头 | 是 | 项目 API Key |
project_name |
Query 参数 | 是 | 必须与 X-API-Key 对应同一个项目 |
服务端会先校验这两个字段是否匹配同一个项目,再从项目配置中取出 tenant_id,然后转调 Identity Platform。
通用错误
This is the opening of the README. Read the full README on GitHub.