/auth/refresh
使用刷新令牌获取新的访问令牌和刷新令牌对,支持复用攻击检测与自动撤销。参考:RFC 6749 §1.5、RFC 7519 (JWT)。
请求体
Schema: service-identity/internal/handler/dto.RefreshTokenRequest
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
refresh_token |
string |
是 | Refresh token |
响应
| 状态 | 描述 | Schema |
|---|---|---|
| 200 | 令牌刷新成功,返回新的访问令牌和刷新令牌 | service-identity/internal/handler/dto.LoginResponse |
| 400 | 请求参数无效或令牌格式错误 | service-core/base/dto.SimpleResponse |
| 500 | 服务器内部错误 | service-core/base/dto.SimpleResponse |
引用的 Schema
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
code |
integer |
否 | |||
message |
string |
否 | |||
timestamp |
string |
否 |
service-identity/internal/handler/dto.LoginResponse
用户登录结果
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
access_token |
string |
否 | eyJhbGciOi... |
Access token | |
challenge_token |
string |
否 | chg_abc123... |
MFA challenge token (short-lived, requires MFA verification) | |
enrolled_mfa_methods |
array of string |
否 | 用户已开通的 MFA 方法(挑战页仅展示这些) | ||
expires_in |
integer |
否 | 1800 |
Expiration time | |
membership_status |
string |
否 | pending |
MembershipStatus 新注册待审批(WS-A A3);pending 时不返回 token。 | |
mfa_check_reason |
string |
否 | new_device |
MFA触发原因描述 | |
must_change_password |
boolean |
否 | False |
Password must be changed | |
password_expires_in |
integer |
否 | 30 |
Days until password expires | |
password_warning |
string |
否 | expiring |
Password warning: expiring/expired_grace/expired | |
refresh_token |
string |
否 | eyJhbGciOi... |
Refresh token | |
required_mfa_methods |
array of string |
否 | MFA推荐方法列表 | ||
requires_mfa |
boolean |
否 | False |
自适应MFA: 需要额外MFA验证 | |
risk_assessment |
object |
否 | Risk assessment | ||
risk_level |
string |
否 | low |
风险等级: low/medium/high | |
token_type |
string |
否 | Bearer |
Token type | |
user |
object |
否 | User info | ||
user_id |
string |
否 | User ID (redundant with User.ID for flat access) |
service-identity/internal/handler/dto.RiskAssessmentInfo
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
level |
string |
否 | |||
recommended_mfa_methods |
array of string |
否 | |||
require_mfa |
boolean |
否 | |||
score |
integer |
否 |
service-identity/internal/handler/dto.UserInfo
用户基本信息
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
|---|---|---|---|---|---|
created_at |
string |
否 | 2026-01-15T10:30:00Z |
Account creation time | |
email |
string |
否 | john@example.com |
||
id |
string |
否 | usr_abc123 |
User ID | |
last_login_at |
string |
否 | 2026-07-20T08:00:00Z |
Last login time | |
metadata |
object |
否 | AUTH-44:metadata 仅 /auth/me 回传(portal 偏好等);其余构造点省略。 | ||
mfa_enabled |
boolean |
否 | True |
AUTH-44:指针 + omitempty —— 仅权威构造点(/auth/me)填充;其余构造点省略该键, 避免登录响应等处误报 mfa_enabled=false(零值不等于"未启用")。 | |
must_change_password |
boolean |
否 | False |
Password must be changed | |
password_expires_in |
integer |
否 | 30 |
Days until password expires | |
password_warning |
string |
否 | expiring |
Password warning: expiring/expired_grace/expired | |
phone |
string |
否 | 13800138000 |
Phone | |
status |
string |
否 | active |
Status | |
username |
string |
否 | john.doe |
Username |