POST /auth/me/switch-tenant
验证用户在新租户下的成员资格,检查跨租户切换策略,验证通过后签发新JWT令牌(含新租户的角色和权限)。参考:NIST SP 800-53 AC-2、OWASP ASVS V1.2。
身份认证 `bearerAuth` application/json
引用的 Schema
service-core/base/dto.SimpleResponse
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
code |
integer |
否 |
|
|
|
message |
string |
否 |
|
|
|
timestamp |
string |
否 |
|
|
|
service-identity/internal/handler/dto.SwitchTenantResponse
service-identity/internal/handler/dto.SwitchTenantResponseWrapper
service-identity/internal/handler/dto.UserInfo
用户基本信息
| 字段 | 类型 | 必填 | 示例 | 约束 | 描述 |
created_at |
string |
否 |
2026-01-15T10:30:00Z |
|
Account creation time |
email |
string |
否 |
john@example.com |
|
Email |
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 |