Summary:
Logs the user in using the supplied credentials and creates a new session.
Specification:
Name |
Min/Max |
Type |
Description |
|
|
|
|
|
|
|
|
|
|
|
User password. |
|
|
|
The timeout value that you would like to use for this session. If the element is omitted, the default timeout value will be used. |
|
|
|
|
Returns:
Name |
Min/Max |
Type |
Description |
|
|
|
The ID of the new session. |
|
|
A token containing the user security information. |
Description:
The login
call authenticates a specified user and creates a new session. If authentication is successful, the response message will contain the new session ID, which must be included in every subsequent Agent request that this user initiates. Before you can use this call, you must establish a permanent connection with Agent using the system/login
call. The difference between the two calls is that system/login
initiates a permanent, default session for the physical connection that your program is using. There can be only one permanent session per connection. The session/login
call (the call described here) creates a temporary user session and can be used to create as many sessions as necessary.
When sending requests through the connection established by the sessionm/login
call, you must include the session ID in every call using the session
element in the message header. Failure to do so will result in the message being sent using the default session created by the system/login
call. The following example shows how to include the session ID in an Agent message.
<packet version="4.0.0">
<session>your_session_id_goes_here</session>
<data>
............
</data>
</packet>
User sessions expire after some predefined period of inactivity or after the timeout limit specified in the expiration
parameter is reached. The default session timeout value is specified in the Agent configuration. If the expiration
element is included in the request then its value overrides the default timeout value. Each request sent while a temporary session is still active resets the session timeout to its initial state.
Example:
Logging in as root
using the system realm.
Input
<packet version="4.0.0" id="2">
<target>sessionm</target>
<data>
<sessionm>
<login>
<name>cm9vdA==</name>
<realm>00000000-0000-0000-0000-000000000000</realm>
<password>bXlwYXNz</password>
</login>
</sessionm>
</data>
</packet>
Ouput
Receiving back the session ID and a token containing the user security information.
<?xml version="1.0" encoding="UTF-8"?><ns1:packet xmlns:ns3="http://www.swsoft.com/webservices/vzl/4.0.0/types" xmlns:ns2="http://www.swsoft.com/webservices/vzl/4.0.0/sessionm" xmlns:ns1="http://www.swsoft.com/webservices/vzl/4.0.0/protocol" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" id="24c46725c2et124r81c" time="2007-06-15T04:50:45+0000" priority="0" version="4.0.0">
<ns1:origin>sessionm</ns1:origin>
<ns1:target>vzclient4-638a2a56-e689-c340-877d-bd0470f2448c</ns1:target>
<ns1:dst>
<ns1:director>gend</ns1:director>
</ns1:dst>
<ns1:data>
<ns2:sessionm>
<ns2:session_id>vzl.40000.4.638a2a56-e689-c340-877d-bd0470f2448c..dc46721aa5t3f82177r1bfa</ns2:session_id>
<ns2:token xsi:type="ns3:tokenType">
<ns3:user>AQUAAAAAIAFWKopjieZAw4d9vQRw8kSMAAAAAA==</ns3:user>
<ns3:groups>
<ns3:sid>AQUAAAAAIABWKopjieZAw4d9vQRw8kSMAAAAAA==</ns3:sid>
<ns3:sid>AQUAAAAAIABWKopjieZAw4d9vQRw8kSMAQAAAA==</ns3:sid>
<ns3:sid>AQUAAAAAIABWKopjieZAw4d9vQRw8kSMCgAAAA==</ns3:sid>
<ns3:sid>AQUAAAAAIABWKopjieZAw4d9vQRw8kSMAgAAAA==</ns3:sid>
<ns3:sid>AQUAAAAAIABWKopjieZAw4d9vQRw8kSMAwAAAA==</ns3:sid>
<ns3:sid>AQUAAAAAIABWKopjieZAw4d9vQRw8kSMBAAAAA==</ns3:sid>
<ns3:sid>AQUAAAAAIABWKopjieZAw4d9vQRw8kSMBgAAAA==</ns3:sid>
<ns3:sid>AQUAAAAAIAFWKopjieZAw4d9vQRw8kSMAAAAAA==</ns3:sid>
</ns3:groups>
<ns3:deny_only_sids/>
<ns3:privileges/>
</ns2:token>
</ns2:sessionm>
</ns1:data>
<ns1:src>
<ns1:director>gend</ns1:director>
</ns1:src>
</ns1:packet>
Sending a request using the new session.
Input
<packet version="4.0.0" id="2">
<session>vzl.40000.4.638a2a56-e689-c340-877d-bd0470f2448c..dc46721aa5t3f82177r1bfa</session>
<target>vzaenvm</target>
<data>
<vzaenvm>
<get_list/>
</vzaenvm>
</data>
</packet>