Change current user LWEB_JOB iSeries (VL Web)

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Change current user LWEB_JOB iSeries (VL Web)

Post by René Houba »

Hi,

I have this issue.

I have a mixed multi tier web environment. Windows web server, data/application server is iSeries.
In the Windows web administrator, you fill in the user that makes the connection to the iSeries (for example DC@PGMLIB).

If a LWEB_JOB now starts on the iSeries, it always run via user DC@PGMLIB. But in the login of the web job, a user has to fill in his iSeries user+password, and via Use Builtin(CHECK_IBMI_SIGNON) I check if that is OK. If OK, I do a #com_owner.StartSession Timeout(3600), but then want to change the current user of the LWEB_JOB into the of the VL Web sign in dialog.
BrendanB
Posts: 134
Joined: Tue Nov 24, 2015 10:29 am

Re: Change current user LWEB_JOB iSeries (VL Web)

Post by BrendanB »

Rene,

To change the user associated with a job, you can use a combination of the Get Profile Handle (QSYGETPH) and Set Profile Handle (QWTSETP) APIs.

Since this will require 'saving' the user+password -- you can persist these fields in your server module.

VL does *NOT* guarantee that you get the same LWEB_JOB everytime you make a server module call, so you need to ensure that you do something like:

Code: Select all

srvroutine named(Something) Session(*REQUIRED)
* whatever required input parameters

#com_self.SaveCurrentJobUser
#com_self.ChangeUser(#persistentUser #persistentPassword)

* whatever work is required by this routine

#com_self.RestoreSavedUser
endroutine
This is required, since each call to a server routine could *technically* attach to a different LWEB_JOB (or the same job could be used by *multiple different browsers/users*).

An example of a CL program that changes the user profile can be found at:
https://www.ibm.com/docs/en/i/7.4?topic ... le-handles

B.
René Houba
Posts: 220
Joined: Thu Nov 26, 2015 7:03 am

Re: Change current user LWEB_JOB iSeries (VL Web)

Post by René Houba »

THANKS Brendan
Post Reply