object user.checkAuthentication
שיטה זו בודקת ומאריכה את הפעלת המשתמש.
::: שימו לב חשוב קריאה לשיטת user.checkAuthentication עם הגדרת הפרמטר sessionid מאריך את הפעלת המשתמש כברירת מחדל. :::
השיטה מקבלת את הפרמטרים הבאים.
| פרמטר | סוג | תיאור |
|---|---|---|
| extend | boolean | האם להאריך את הפעלת המשתמש. ערך ברירת מחדל: "true". הגדרת הערך ל-"false" מאפשרת לבדוק את הפעלת המשתמש מבלי להאריך אותה. משמש אם sessionid מוגדר. |
| sessionid | string | מזהה הפעלה של משתמש. נדרש אם 'אסימון' אינו מוגדר. |
| token | string | משתמש אסימון API. חובה אם לא הוגדר 'sessionid'. |
(אובייקט) מחזירה אובייקט המכיל מידע על המשתמש.
בַּקָשָׁה:
{ "jsonrpc": "2.0", "method": "user.checkAuthentication", "params": { "sessionid": "673b8ba11562a35da902c66cf5c23fa2" }, "מזהה": 1 }תְגוּבָה:
{ "jsonrpc": "2.0", "תוצאה": { "userid": "1", "username": "מנהל", "name": "Zabix", "surname": "מנהל", "url": "", "autologin": "1", "autologout": "0", "lang": "ru_RU", "refresh": "0", "theme": "ברירת מחדל", "attempt_failed": "0", "attempt_ip": "127.0.0.1", "attempt_clock": "1355919038", "rows_per_page": "50", "timezone": "אירופה/ריגה", "roleid": "3", "סוג": 3, "sessionid": "673b8ba11562a35da902c66cf5c23fa2" "debug_mode": 0, "userip": "127.0.0.1", "gui_access": 0 }, "מזהה": 1 }התגובה דומה ל User.login תגובת שיחה עם פרמטר "userData" מוגדר כ-true (ההבדל הוא שנתוני המשתמש הם מאוחזר על ידי מזהה הפעלה ולא על ידי שם משתמש / סיסמה).
Check and prolong a user session using the user authentication token, and return additional information about the user.
{ "jsonrpc": "2.0", "method": "user.checkAuthentication", "params": { "sessionid": "673b8ba11562a35da902c66cf5c23fa2" }, "id": 1 }Response:
{ "jsonrpc": "2.0", "result": { "userid": "1", "username": "Admin", "name": "Zabbix", "surname": "Administrator", "url": "", "autologin": "1", "autologout": "0", "lang": "ru_RU", "refresh": "0", "theme": "default", "attempt_failed": "0", "attempt_ip": "127.0.0.1", "attempt_clock": "1355919038", "rows_per_page": "50", "timezone": "Europe/Riga", "roleid": "3", "userdirectoryid": "0", "ts_provisioned": "0", "type": 3, "userip": "127.0.0.1", "debug_mode": 0, "gui_access": "0", "deprovisioned": false, "auth_type": 0, "sessionid": "673b8ba11562a35da902c66cf5c23fa2", "secret": "0e329b933e46984e49a5c1051ecd0751" }, "id": 1 }Check a user session using the user API token, and return additional information about the user.
{ "jsonrpc": "2.0", "method": "user.checkAuthentication", "params": { "token": "00aff470e07c12d707e50d98cfe39edef9e6ec349c14728dbdfbc8ddc5ea3eae" }, "id": 1 }Response:
{ "jsonrpc": "2.0", "result": { "userid": "1", "username": "Admin", "name": "Zabbix", "surname": "Administrator", "url": "", "autologin": "1", "autologout": "0", "lang": "ru_RU", "refresh": "0", "theme": "default", "attempt_failed": "0", "attempt_ip": "127.0.0.1", "attempt_clock": "1355919338", "rows_per_page": "50", "timezone": "Europe/Riga", "roleid": "3", "userdirectoryid": "0", "ts_provisioned": "0", "type": 3, "userip": "127.0.0.1", "debug_mode": 0, "gui_access": "1", "deprovisioned": false, "auth_type": 0 }, "id": 1 }CUser::checkAuthentication() בתוך ui/include/classes/api/services/CUser.php.