object user.checkAuthentication
此方法检查并延长用户会话。
该方法支持以下参数。
参数 [ | 型](/zh/manual/api/reference_commentary#data_types) 描述 | |
---|---|---|
extend | boolean | 默认值:“true”。将其值设置为“false”允许检查会话而不延长其生存期。从Zabbix 4.0开始支持。 |
sessionid | string | 用户会话id。 |
<note important>调用检查认证方法默认情况下延长用户会话。. :::
(object)
返回包含用户信息的对象.
Request:
{
"jsonrpc": "2.0",
"method": "user.checkAuthentication",
"params": {
"sessionid": "8C8447FF6F61D134CEAC740CCA1BC90D"
},
"id": 1
}
Response:
{
"jsonrpc": "2.0",
"result": {
"userid": "1",
"alias": "Admin",
"name": "Zabbix",
"surname": "Administrator",
"url": "",
"autologin": "1",
"autologout": "0",
"lang": "ru_RU",
"refresh": "0",
"type": "3",
"theme": "default",
"attempt_failed": "0",
"attempt_ip": "127.0.0.1",
"attempt_clock": "1355919038",
"rows_per_page": "50",
"debug_mode": true,
"userip": "127.0.0.1",
"sessionid": "8C8447FF6F61D134CEAC740CCA1BC90D",
"gui_access": "0"
},
"id": 1
}
响应类似于用户登陆 userData
参数设置为true的调用响应(区别在于,用户数据是通过会话id而不是用户名/密码检索的)。
CUser::checkAuthentication() in ui/include/classes/api/services/CUser.php.