manual:api:reference:user:checkauthentication

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

manual:api:reference:user:checkauthentication [2021/09/20 07:32] (current)
Andrejs.Griscenko re-created the page with the correct URL
Line 1: Line 1:
 +===== user.checkAuthentication =====
  
 +==== Description ====
 +
 +''​object user.checkAuthentication''​
 +
 +This method checks and prolongs user session.
 +
 +<note important>​Calling **user.checkAuthentication** method prolongs user session by default.</​note>​
 +
 +==== Parameters ====
 +
 +The method accepts the following parameters.
 +
 +^ Parameter ^ [[:​manual/​api/​reference_commentary#​data_types|Type]] ^ Description ^
 +| extend | boolean | Default value: "​true"​. Setting it's value to "​false"​ allows to check session without extending it's lifetime. Supported since Zabbix 4.0. |
 +| sessionid | string | User session id. |
 +
 +==== Return values ====
 +
 +''​(object)''​ Returns an object containing information about user. 
 +
 +==== Examples ====
 +Request:
 +<code java>
 +{
 +    "​jsonrpc":​ "​2.0",​
 +    "​method":​ "​user.checkAuthentication",​
 +    "​params":​ {
 +        "​sessionid":​ "​673b8ba11562a35da902c66cf5c23fa2"​
 +    },
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +Response:
 +<code java>
 +{
 +    "​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",​
 +        "​type":​ 3,
 +        "​sessionid":​ "​673b8ba11562a35da902c66cf5c23fa2"​
 +        "​debug_mode":​ 0,
 +        "​userip":​ "​127.0.0.1",​
 +        "​gui_access":​ 0
 +    },
 +    "​id":​ 1
 +}
 +</​code>​
 +
 +<​note>​Response is similar to [[manual:​api:​reference:​user:​login|User.login]] call response with "​userData"​ parameter set to true (the difference is that user data is retrieved by session id and not by username / password).</​note>​
 +
 +==== Source ====
 +
 +CUser::​checkAuthentication() in //​ui/​include/​classes/​api/​services/​CUser.php//​.