BPM, Workflow, and Case

BPM, Workflow, and Case

Come for answers. Stay for best practices. All we’re missing is you.

 View Only
  • 1.  http session

    Posted Fri December 20, 2024 06:54 AM

    Hi all,
    is it possible to access the underlying http session from the Process Portal (similarly to how I would do in a standard scenario with request.getSession API?)

    Many thanks



    ------------------------------
    Domenico Di Santo
    IBM
    ------------------------------


  • 2.  RE: http session

    Posted Sun December 22, 2024 04:09 AM

    Hello Domenico,

    Can you please explain the purpose of this ?

    Thanks!



    ------------------------------
    Atanu Roy
    Lead Engineer
    London Stock Exchange Group
    ------------------------------



  • 3.  RE: http session

    Posted Tue January 07, 2025 04:33 AM

    Hi Atanu,

    the purpose of this is to provide the logged user with a safe place to store a security token/refresh token, which is used to call an external REST API service. Since the security/refresh token expires in ten minutes, we need a place to store the token to retrieve it every time the user needs to call the REST API, to avoid asking for a new token for each interaction with the REST service - which is very frequent.

    Thanks for your help, any suggestions will be appreciated!



    ------------------------------
    Domenico Di Santo
    IBM
    ------------------------------



  • 4.  RE: http session

    Posted Tue January 07, 2025 04:57 AM

    Hello Domenico,

    Thanks for explaining the requirement.

    So, for your use case, what I understood, you are looking to cache the token somewhere.

    You can use the sessionStorage object which will let you store key/value pairs in the browser,  the sessionStorage object stores data for only one session and the data is deleted when the browser is closed.

    This is how you can use it - 

    sessionStorage.setItem("token", "your_token");
    sessionStorage.getItem("token");

    Hope this helps!

    Thanks!



    ------------------------------
    Atanu Roy
    Lead Engineer
    London Stock Exchange Group
    ------------------------------



  • 5.  RE: http session

    Posted Tue January 07, 2025 07:02 AM

    Hi Atanu,

    many thanks for your suggestion, but I'm not sure sessionStorage should be relied upon for storage of security-related data. I would prefer a server side approach for security tokens, that's why I was thinking about http session.

    Many thanks!



    ------------------------------
    Domenico Di Santo
    IBM
    ------------------------------



  • 6.  RE: http session

    Posted Tue January 07, 2025 07:33 AM

    Hello Domenico,

    Okay, if you are looking to store it in the server side, then you can use a proper cache solution like DynaCache to store it.

    Thanks!



    ------------------------------
    Atanu Roy
    Lead Engineer
    London Stock Exchange Group
    ------------------------------