Maximo

 View Only
  • 1.  Differentiate LOGIN and LOGOUT from Maximo UI and a REST API

    Posted 15 days ago

    Hi,

    We have a requirement where we need to log the message as soon as a user logs in or logs out from Maximo UI OR through a REST API. Currently we have added a script on MAXSESSION and LOGINTRACKING table. As soon as an entry is added into these tables we are logging the same in the logs.

    Challenge is differentiating MAXIMO and REST login. Since in both ways entries are added into this table, we are unable to differentiate if the login was done using Maximo UI or a REST API. We tried using interactive flag and also userInfo().isRestUser() methods but both are returning false in both the cases which is strange.

    Any pointers on how to differentiate Maximo and REST API LOGIN/LOGOUT?



    ------------------------------
    Suhas Joshi
    ------------------------------


  • 2.  RE: Differentiate LOGIN and LOGOUT from Maximo UI and a REST API

    Posted 15 days ago

    Hello!

    There are servernames in logintracking, isn't for REST MIF server used? We have name for ir MXMIF, and then there are 4 MXUI servers.



    ------------------------------
    Juris Flugins
    ------------------------------



  • 3.  RE: Differentiate LOGIN and LOGOUT from Maximo UI and a REST API

    Posted 14 days ago

    Try maybe that:

    from psdi.iface.mic import IntegrationContext
    
    if IntegrationContext is None or IntegrationContext.getCurrentContext() is None : 
       is not REST
    esle:
      is UI

    or try to find UI context:

    from psdi.common.context import UIContext
    
    if UIContext.getCurrentContext() is not None:
       UI login
    else
      REST login


    ------------------------------
    Andrey Ilinskiy
    Handz.on
    https://www.on.de/
    München
    ------------------------------



  • 4.  RE: Differentiate LOGIN and LOGOUT from Maximo UI and a REST API

    Posted 8 days ago
    Edited by Suhas Joshi 8 days ago

    Hi Andrey,

    I tried the above approach. I have written a script on LOGINTRACING object and below are the results.

        UI Context Value Integration Context Value
           
    Maximo Login Not Null Null
    Logout Null Null
           
    Integration Login Not Null Null
    Logout Null Null

    If you look at the results, we still don't know how to differentiate Maximo and Integration login/logout.



    ------------------------------
    Suhas Joshi
    ------------------------------