API 参考

会话

查看和管理活跃用户会话。适用于审计和强制退出可疑活动。

会话对象

json
{
  "id": "sess_abc123",
  "userId": "usr_abc123",
  "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)...",
  "ipAddress": "203.0.113.1",
  "country": "KR",
  "createdAt": "2026-01-15T10:30:00Z",
  "lastActiveAt": "2026-01-15T11:45:00Z",
  "expiresAt": "2026-01-16T10:30:00Z"
}
GET/v1/dashboard/sessions

列出活跃会话

列出项目中所有活跃会话。需要私密密钥。

响应
json
{
  "sessions": [
    {
      "id": "sess_abc123",
      "userId": "usr_abc123",
      "userAgent": "Chrome/120...",
      "ipAddress": "203.0.113.1",
      "lastActiveAt": "2026-01-15T11:45:00Z"
    }
  ],
  "total": 15
}
GET/v1/dashboard/users/:userId/sessions

列出用户会话

列出指定用户的所有活跃会话。

响应
json
{ "sessions": [...], "total": 3 }
DELETE/v1/dashboard/sessions/:sessionId

撤销会话

强制退出指定会话。用户将立即在该设备上退出登录。

响应
json
{ "success": true }
DELETE/v1/dashboard/users/:userId/sessions

撤销用户所有会话

强制退出指定用户在所有设备上的所有会话。

响应
json
{ "revoked": 3 }
Authon — Universal Authentication Platform