GET/api/v1/auth/attempt查看登录尝试状态
Try it 面板需要启用 JavaScript。
以尝试工单换取当前分数、阈值与可选因素,供前端决定下一步展示;查看不消费工单。
Request
Query Parameters
| Name | Data Type | Required | Description |
| ticket | string | Yes | 尝试工单 |
type QueryParams = {
/** 尝试工单 */
ticket: string
}
{
"ticket": "atk_9f2c7be14d0a53e8"
}
Response
Body
| Name | Data Type | Required | Description |
| attemptTicket | string | Yes | 尝试工单(不透明,后续因素继续携带) |
| status | string | Yes | pending 未达标 / satisfied 已达标 |
| score | number | Yes | 当前累加分数 |
| threshold | number | Yes | 签发会话所需阈值 |
| verifiedFactors | array | Yes | 已通过的因素(password / otp / mfa / captcha) |
| nextFactors | array | Yes | 按配置仍可选的下一因素 |
| expiresAt | string | Yes | 尝试与工单的过期时间 |
type AttemptStateDTO = {
/** 尝试工单(不透明,后续因素继续携带) */
attemptTicket: string
/** pending 未达标 / satisfied 已达标 */
status: string
/** 当前累加分数 */
score: number
/** 签发会话所需阈值 */
threshold: number
/** 已通过的因素(password / otp / mfa / captcha) */
verifiedFactors: string[]
/** 按配置仍可选的下一因素 */
nextFactors: string[]
/** 尝试与工单的过期时间 */
expiresAt: string
}
{
"attemptTicket": "atk_9f2c7be14d0a53e8",
"status": "pending",
"score": 40,
"threshold": 60,
"verifiedFactors": [
"password"
],
"nextFactors": [
"otp",
"mfa",
"captcha"
],
"expiresAt": "2026-10-14T08:10:00Z"
}
HTTP Code
| HTTP Status |
Meaning |
Notes |
| 200 |
成功 |
返回尝试状态 |
| 400 |
工单无效 |
工单不存在或已过期 |
Response Code
响应使用统一信封 {id, code, messages, result},其 code 字段:
| code |
Meaning |
Notes |
| 0 |
成功 |
返回尝试状态 |
| 2007 |
尝试工单无效 |
工单不存在、过期或已消费 |
Examples
GET /api/v1/auth/attempt?ticket=atk_9f2c7be14d0a53e8
{
"id": "01JD8SH6T1N8M2Y1",
"code": 0,
"messages": [],
"result": {
"attemptTicket": "atk_9f2c7be14d0a53e8",
"status": "pending",
"score": 40,
"threshold": 60,
"verifiedFactors": ["password"],
"nextFactors": ["otp", "mfa", "captcha"],
"expiresAt": "2026-10-14T08:10:00Z"
}
}