列出用户登录会话
功能介绍
查询指定用户的登录会话信息。此操作只能由组织的管理账号或作为服务委托管理员的成员账号调用。
调试
您可以在API Explorer中调试该接口,支持自动认证鉴权。API Explorer可以自动生成SDK代码示例,并提供SDK代码示例调试功能。
URI
GET /v1/identity-stores/{identity_store_id}/users/{user_id}/sessions
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
identity_store_id |
是 |
String |
身份源的全局唯一标识符(ID) |
user_id |
是 |
String |
身份源中IdentityCenter用户的全局唯一标识符(ID) |
请求参数
参数 |
是否必选 |
参数类型 |
描述 |
---|---|---|---|
X-Security-Token |
否 |
String |
如果正在使用临时安全凭据,则此header是必需的,该值是临时安全凭据的安全令牌(会话令牌)。 |
响应参数
状态码:200
参数 |
参数类型 |
描述 |
---|---|---|
session_list |
Array of UserSessionDto objects |
用户登录会话列表 |
参数 |
参数类型 |
描述 |
---|---|---|
creation_time |
Long |
会话创建时间 |
ip_address |
String |
用户IP地址 |
session_id |
String |
会话ID |
session_not_valid_after |
Long |
会话失效时间 |
user_agent |
String |
用户客户端信息 |
user_id |
String |
用户唯一标识ID |
状态码:400
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码 |
error_msg |
String |
错误信息 |
request_id |
String |
请求唯一标识 |
状态码:403
参数 |
参数类型 |
描述 |
---|---|---|
error_code |
String |
错误码 |
error_msg |
String |
错误信息 |
request_id |
String |
请求唯一标识 |
encoded_authorization_message |
String |
加密的错误信息 |
请求示例
查询指定用户的登录会话信息
GET https://{hostname}/v1/identity-stores/{identity_store_id}/users
响应示例
状态码:200
Successful
{ "session_list" : [ { "creation_time" : 1753858567, "ip_address" : "your ip", "session_id" : "ea70c04b-d510-41c7-b0d1-51d56xxxx", "session_not_valid_after" : 1753887367, "user_agent" : "[Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36]", "user_id" : "201dca3f-965b-4311-xxxx-xxxx" } ] }
状态码
状态码 |
描述 |
---|---|
200 |
Successful |
400 |
Bad request |
403 |
Forbidden |
错误码
请参见错误码。