search cancel

How to modify Rest API logout time

book

Article ID: 190495

calendar_today

Updated On:

Products

CA Service Management - Asset Portfolio Management CA Service Management - Service Desk Manager

Issue/Introduction

Issue:
======
When RestApi session is logged out via DELETE Method though the corresponding row is deleted from usp_rest_access table there is no logout time recorded in the session_log table. Also unable to modify Rest API logout time below 60 minutes.

Steps:
=====
1. Install SOAPUI and configure REST API.
2. Generate login id using POST method.
3. Now try to logout the id using DELETE method.
4. The corresponding row is successfully deleted from usp_rest_access table.
5. However in the session_log table the logout time is not updated for that corresponding row, it is blank.
6. If session not deleted then session_log table is updated with default 60 min logout time.
7. Noted that:
   NXVariable = "NX_REST_WEBSERVICE_ACCESS_DURATION";            // verify NX variable name
   internalDefault = 168 * 60 * 60;        // Internal default (1 wk) if Option is not set
   so even if we change it to 1, that means 1 * 60 * 60 seconds which is 3600 seconds is the minimum

 

Environment

Release : 17.1

Component : Svc Desk Web Services

Resolution

The session logout and the rest access duration are 2 different things.  So, even though the session has been logged out, REST access still needs to be removed via the DELETE API method. The default session logout is 60 mins and the rest access duration is a week, 168 hours.

To control the rest session logout, use NX_REST_SESSION_OBJECT_DELETE_DELAY variable in NX.env.  It takes a number for seconds.

For example, for 2 mins it is as follows:

NX_REST_SESSION_OBJECT_DELETE_DELAY=120

# Update the value as required in Nx.env file and recycle services for the changes to take affect.