Frameworks and IBMi user profile

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
ESODevKJ
Posts: 30
Joined: Tue Nov 10, 2020 9:07 am

Frameworks and IBMi user profile

Post by ESODevKJ » Fri May 21, 2021 4:47 am

Hello All,

From LANSA:

Code: Select all

* As another example, this is an IBM i CL program that validates a user profile and
* password and then changes the current IBM i job to run under that profile. It also
* contains outline code to change the job’s library list.
*
PGM        PARM(&USERPROF &PASSWORD &CHANGEJOB &CHANGELIBL &HANDLE +
*             &RETCODE &ERRORMSG)
I created the CL program above and called our CL where Lansa indicates we should. IBMi is still not capturing user profile and is still putting everything from Frameworks under DFTUSR.

What am I missing so that IBMi captures correct user instead of dftusr?

Thanks!

René Houba
Posts: 86
Joined: Thu Nov 26, 2015 7:03 am

Re: Frameworks and IBMi user profile

Post by René Houba » Fri May 21, 2021 5:52 am

Hi,

Where is your CL example comming from? It is not complete...

Did you look at:
https://docs.lansa.com/15/en/lansa048/i ... %20profile

ESODevKJ
Posts: 30
Joined: Tue Nov 10, 2020 9:07 am

Re: Frameworks and IBMi user profile

Post by ESODevKJ » Fri May 21, 2021 6:08 am

Hi,

Do you mean this:

Code: Select all

Call Pgm(FWLOGIN) Parm(#USERPROF #PASSWORD #CHANGEJOB #CHANGELIBL #HANDLE #RETCODE #ERRORMSG)
That links seems to be to capture user profile for audit purposes. That's already done, when user changes a file we are capturing the correct user profile. It's any job that goes to the IBMi that uses DFTUSR that doesn't work. That's why I created the CL program, but it's still not working.

User avatar
Dino
Posts: 134
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Frameworks and IBMi user profile

Post by Dino » Fri May 21, 2021 10:22 am

You have a few steps to do, some are discussed here:
viewtopic.php?f=3&t=2420&p=6960&hilit=USER_AUDIT#p6960

and the program used in the UF_OLONG reusable part works fine for that kind of validation

Code: Select all

If (*osapi = IBMI)

#U3GUserProfile := #UserProfile.UpperCase /* IBM i servers like uppercase user profiles */
#U3GPassword := #Password.AsNativeString

Call Pgm(UF_3GCHKPW) Parm(#U3GUserProfile #U3GPassword #U3GReturnCode) If_Error(*NEXT)

Case (#U3GReturnCode)
When (= OK)
#u3GErrorMessage := ""
When (= IU)
#u3GErrorMessage := *MTXTUF_OLOGON_002
When (= IP)
#u3GErrorMessage := *MTXTUF_USRPASSW
When (= EX)
#u3GErrorMessage := *MTXTUF_USR_PSW_EXP
When (= UD)
#u3GErrorMessage := *MTXTUF_DIS_USERNAME
Otherwise
#u3GErrorMessage := *MTXTUF_OLOGON_003 + *MTXTUF_FAILED
Endcase

If (#u3GErrorMessage <> "")
#ValidationReturnCode := ER
Message Msgtxt(#u3GErrorMessage)
Endif

Else

User avatar
Dino
Posts: 134
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Frameworks and IBMi user profile

Post by Dino » Fri May 21, 2021 11:27 pm

Hi,

I Created that CL commented there, I called it CHGJOBUSR and also created a simple test CL to call it, I called this CL TESTCHGJOB.
(My system is running at V7R3):

Code: Select all

PGM                                                                   
                                                                      
DCL        VAR(&USERPROF) TYPE(*CHAR) LEN(10)                         
DCL        VAR(&PASSWORD) TYPE(*CHAR) LEN(128)                        
DCL        VAR(&CHANGEJOB) TYPE(*CHAR) LEN(1)                         
DCL        VAR(&CHANGELIBL) TYPE(*CHAR) LEN(1)                        
DCL        VAR(&HANDLE) TYPE(*CHAR) LEN(12)                           
DCL        VAR(&RETCODE) TYPE(*CHAR) LEN(2)                           
DCL        VAR(&ERRORMSG) TYPE(*CHAR) LEN(132)                        
                                                                      
CHGVAR &USERPROF DINOTEST                                           
CHGVAR &PASSWORD TESTING                                              
CALL CHGJOBUSR (&USERPROF  &PASSWORD Y N &HANDLE &RETCODE &ERRORMSG)  
WRKSPLF    OUTPUT(*PRINT)                                
                                                                      
ENDPGM
and in this section of the Server_System_Manager and placed my call to the CL:

Code: Select all

* Do any execution context initialization at the start of any server module
* For example, set the user profile that all Server Module jobs will run
* under, or set the library list that all Server Module jobs will run under

* For example, you might consider altering LANSA’s audit user here using the
* SET_SESSION_VALUE built-in function:
* Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT <<user name>>)
Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT #PersistentString1.AsNativeString)
* https://%lansadocs%/lansa015/index.htm#lansa/ladtgub4_user_variables.htm?Highlight=USER_AUDIT

Call Pgm(TESTCHGJOB)

* As another example, this is an IBM i CL program that validates a user profile and
* password and then changes the current IBM i job to run under that profile. It also
* contains outline code to change the job’s library list.
Checkin all, and when I run the VLF-ONE in the IBM, using my user DINO and I try to access one of the object tables in the application, the WRKSPLF indicated in the TESTCHGJOB CL, is created using the user DINOTEST instead of the original user DINO I used to logon to the VLF.

Notice that you will need to bring to this routine, not just the user profile, but also the password of that user to make it work... you may want to use a persistent value for that, but you may also want to encrypt that.

Notice I only had the user there, so in my testing CL have the password for the user DINOTEST fixed in the test CL.

ESODevKJ
Posts: 30
Joined: Tue Nov 10, 2020 9:07 am

Re: Frameworks and IBMi user profile

Post by ESODevKJ » Fri May 21, 2021 11:54 pm

Thanks Dino, this is good stuff. I can't figure out how to bring the user/password to the routine.

Code: Select all

* For example, you might consider altering LANSA’s audit user here using the
* SET_SESSION_VALUE built-in function:
Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT #PersistentString1.AsNativeString)
* https://%lansadocs%/lansa015/index.htm#lansa/ladtgub4_user_variables.htm?Highlight=USER_AUDIT
I have the above in the #systemservermanager which works fine, the correct user is logged for audit purposes. In debug, my user/password fields are blank when it gets to the #serversystemmanager. In the #ologon I see user/password fine. I'm guessing I have to bring user/password from #ologon to #serversystemmanager, but not sure the correct way to persist them.

Any ideas?

User avatar
Dino
Posts: 134
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Frameworks and IBMi user profile

Post by Dino » Sat May 22, 2021 12:39 am

moving one step forward, changing in the Logon_Validation this section to store the password:

Code: Select all

* The Persistent_ApplicationString's 1 through 5 can be used to pass information to you
* own web service routines. For this example we will just return them as example strings.
* #Persistent_ApplicationString1 := "Example string 1"
#Persistent_ApplicationString1 := #UserProfiletoCheck
#Persistent_ApplicationString2 := #PasswordToCheck
#Persistent_ApplicationString3 := "Example string 3"
#Persistent_ApplicationString4 := "Example string 4"
#Persistent_ApplicationString5 := "Example string 5"
and changing the TEST cl to use it:

Code: Select all

PGM (&USERPROF &PASSWORD)                                                 
                                                                          
/* RECEIVED PARMS */                                                      
DCL        VAR(&USERPROF) TYPE(*CHAR) LEN(10)                             
DCL        VAR(&PASSWORD) TYPE(*CHAR) LEN(128)                            
DCL        VAR(&CHANGEJOB) TYPE(*CHAR) LEN(1)                             
DCL        VAR(&CHANGELIBL) TYPE(*CHAR) LEN(1)                            
DCL        VAR(&HANDLE) TYPE(*CHAR) LEN(12)                               
                                                                          
/* RETURNED PARMS */                                                      
DCL        VAR(&RETCODE) TYPE(*CHAR) LEN(2)                               
DCL        VAR(&ERRORMSG) TYPE(*CHAR) LEN(132)                            
                                                                          
CALL CHGJOBUSR (&USERPROF  &PASSWORD Y N &HANDLE &RETCODE &ERRORMSG)      
             WRKSPLF    OUTPUT(*PRINT)                                    
                                                                          
ENDPGM
and changing the Server System Manager reusable part to:

Code: Select all

#STD_TEXT := #PersistentString1.AsNativeString.UpperCase
#STD_TEXTL := #PersistentString2.AsNativeString.uppercase
Call Pgm(TESTCHGJOB) Parm(#STD_TEXT #STD_TEXTL)
I get the user and password correctly to that routine. notice that to avoid error, i needed to receive it as uppercase...
now, not error, but not doing the change of user. will need to check it further later.

ESODevKJ
Posts: 30
Joined: Tue Nov 10, 2020 9:07 am

Re: Frameworks and IBMi user profile

Post by ESODevKJ » Sat May 22, 2021 1:25 am

Thanks again Dino. I have the same code you have, but I'm not even getting the user/pw to the routine (the persiststrings are blank).

ServerSystem:

Code: Select all

Mthroutine Name(InitializeServiceRoutine)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString1)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString2)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString3)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString4)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString5)

Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT #PersistentString1.AsNativeString)
* https://%lansadocs%/lansa015/index.htm#lansa/ladtgub4_user_variables.htm?Highlight=USER_AUDIT

Define Field(#USERPROF) Type(*CHAR) Length(10)
Define Field(#PASSWORD) Type(*CHAR) Length(128)
Define Field(#CHANGEJOB) Type(*CHAR) Length(1)
Define Field(#CHANGELIBL) Type(*CHAR) Length(1)
Define Field(#HANDLE) Type(*CHAR) Length(12)
Define Field(#ERRORMSG) Type(*CHAR) Length(132)

#USERPROF := #PersistentString2.AsNativeString.UpperCase
#PASSWORD := #PersistentString3.AsNativeString.uppercase
Call Pgm(FWLOGIN) Parm(#USERPROF #PASSWORD #CHANGEJOB #CHANGELIBL #HANDLE #RETCODE #ERRORMSG)
LOGON:

Code: Select all

* The Persistent_ApplicationString's 1 through 5 can be used to pass information to you
* own web service routines. For this example we will just return them as example strings.
* #Persistent_ApplicationString1 := "Example string 1"
#Persistent_ApplicationString3 := #PassWordtoCheck
#Persistent_ApplicationString2 := #userprofiletocheck
* #Persistent_ApplicationString2 := "Example string 2"
* #Persistent_ApplicationString3 := "Example string 3"
#Persistent_ApplicationString4 := "Example string 4"
#Persistent_ApplicationString5 := "Example string 5"
A server routine in 1 of my server modules captured the 2 persiststrings that had username/password, so I must be missing something for the routine in the ServerSystem

gerryc
Posts: 10
Joined: Fri Apr 21, 2017 8:32 pm

Re: Frameworks and IBMi user profile

Post by gerryc » Tue May 25, 2021 2:03 am

Hi - Have you used the PERSIST command in the Server Module?
E.g. Persist Fields(#PersistentString1 #PersistentString2 #PersistentString3 #PersistentString4 #PersistentString5)

User avatar
Dino
Posts: 134
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Frameworks and IBMi user profile

Post by Dino » Tue May 25, 2021 2:10 am

The server module generated by the assistant already had the persist on it:

Code: Select all

* ---------------------------------------------------------------------------------
* This is a server module in framework T19 Framework.
* It belongs to business object dpto.
* Created 21st May 2021 by G14RAULO with Material Design style controls.
* ---------------------------------------------------------------------------------
Begin_Com Role(*EXTENDS #PRIM_SRVM) Sessionidentifier('VLFONE')
* ---------------------------------------------------------------------------------
* Declare the shared server system manager. It must be declared exactly this
* way in any server modules or reusable parts that want to use it.
Define_Com Class(#T19_ServerSystemManager) Name(#ServerSystemManager) Scope(*APPLICATION)
* These strings coming from the logon validator. They allow the logon validator to pass information
* into your shared server system manager. For example, an IBM i library list to be used, or
* details about the currently logged on user or other system states.
Define Field(#Persistent_ApplicationString1) Type(*NVARCHAR)
Define Field(#Persistent_ApplicationString2) Type(*NVARCHAR)
Define Field(#Persistent_ApplicationString3) Type(*NVARCHAR)
Define Field(#Persistent_ApplicationString4) Type(*NVARCHAR)
Define Field(#Persistent_ApplicationString5) Type(*NVARCHAR)
Define Field(#Persistent_EventDetails) Reffld(#std_strng)

Persist Fields(#Persistent_ApplicationString1 #Persistent_ApplicationString2 #Persistent_ApplicationString3 #Persistent_ApplicationString4 #Persistent_ApplicationString5 #Persistent_EventDetails)

ESODevKJ
Posts: 30
Joined: Tue Nov 10, 2020 9:07 am

Re: Frameworks and IBMi user profile

Post by ESODevKJ » Tue May 25, 2021 11:10 pm

Anyone else have any luck figuring this out?

User avatar
Dino
Posts: 134
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Frameworks and IBMi user profile

Post by Dino » Wed Jun 02, 2021 10:37 am

ESODevKJ wrote:
Sat May 22, 2021 1:25 am
Thanks again Dino. I have the same code you have, but I'm not even getting the user/pw to the routine (the persiststrings are blank).

ServerSystem:

Code: Select all

Mthroutine Name(InitializeServiceRoutine)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString1)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString2)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString3)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString4)
Define_Map For(*BOTH) Class(#Prim_dc.UnicodeString) Name(#PersistentString5)

Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT #PersistentString1.AsNativeString)
* https://%lansadocs%/lansa015/index.htm#lansa/ladtgub4_user_variables.htm?Highlight=USER_AUDIT

Define Field(#USERPROF) Type(*CHAR) Length(10)
Define Field(#PASSWORD) Type(*CHAR) Length(128)
Define Field(#CHANGEJOB) Type(*CHAR) Length(1)
Define Field(#CHANGELIBL) Type(*CHAR) Length(1)
Define Field(#HANDLE) Type(*CHAR) Length(12)
Define Field(#ERRORMSG) Type(*CHAR) Length(132)

#USERPROF := #PersistentString2.AsNativeString.UpperCase
#PASSWORD := #PersistentString3.AsNativeString.uppercase
Call Pgm(FWLOGIN) Parm(#USERPROF #PASSWORD #CHANGEJOB #CHANGELIBL #HANDLE #RETCODE #ERRORMSG)
LOGON:

Code: Select all

* The Persistent_ApplicationString's 1 through 5 can be used to pass information to you
* own web service routines. For this example we will just return them as example strings.
* #Persistent_ApplicationString1 := "Example string 1"
#Persistent_ApplicationString3 := #PassWordtoCheck
#Persistent_ApplicationString2 := #userprofiletocheck
* #Persistent_ApplicationString2 := "Example string 2"
* #Persistent_ApplicationString3 := "Example string 3"
#Persistent_ApplicationString4 := "Example string 4"
#Persistent_ApplicationString5 := "Example string 5"
A server routine in 1 of my server modules captured the 2 persiststrings that had username/password, so I must be missing something for the routine in the ServerSystem

Well, not really.... While looking for this example for another thing, I noticed that you are using String1 2 and 3. in part of your code, string2 is the one with the user and 3 with the password. in other, string1 is the one with the user....

ESODevKJ
Posts: 30
Joined: Tue Nov 10, 2020 9:07 am

Re: Frameworks and IBMi user profile

Post by ESODevKJ » Tue Jun 08, 2021 4:39 am

Yes,

Code: Select all

Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT #PersistentString1.AsNativeString)
I have set for audit entries (works correctly).

I tried using string2/3 for another user/pw because I didn't want to interrupt what was already working. In debug I see username for string1/2 and pw in string 3, when I'm in a server routine. These values do not pass to the server system manager unfortunately.

Seems like no one else besides me needs this functionality, but Lansa is dropping the ball here. They have the CL program all ready to use, but no further troubleshooting documentation if it doesn't work.

User avatar
Dino
Posts: 134
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Frameworks and IBMi user profile

Post by Dino » Thu Jun 10, 2021 2:45 am

Hi,
I Did another check to this, added information now in a test file (TESTLOG) to see if the values are been received or not. And they are.
The thing to be careful is capitals and lowercase values for the password in particular that are received in the API, I get this kind of log:

Code: Select all

20210609174032 T19_LOGONVALIDATION g14raultst    
20210609174039 T19_ServerSystemManager g14raultst
G14RAULTSTtemporal                               
IPINVALID PASSWORD.                              
and the password is correct, but looks like the problem is length of the field password, or trim, or something like that. It works fine if you call the CL from the command line without extra spaces, so, something around that.

My logon validation have now this lines, note the insert in the testlog which creates the first line you saw before:

Code: Select all

* The Persistent_ApplicationString's 1 through 5 can be used to pass information to you
* own web service routines. For this example we will just return them as example strings.
* #Persistent_ApplicationString1 := "Example string 1"
#Persistent_ApplicationString1 := #UserProfiletoCheck
#Persistent_ApplicationString2 := #PasswordToCheck
#Persistent_ApplicationString3 := "Example string 3"
#Persistent_ApplicationString4 := "Example string 4"
#Persistent_ApplicationString5 := "Example string 5"
#STD_STRNG := #DATETIMEX.now.AsDisplayString( CCYYMMDDHHMMSS ) + ' T19_LOGONVALIDATION ' + #Persistent_ApplicationString1.AsNativeString
Insert Fields(#STD_STRNG) To_File(TESTLOG)
This lines in my server manager, value is received there as you can see in the log before:

Code: Select all

Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT #PersistentString1.AsNativeString)
* https://%lansadocs%/lansa015/index.htm#lansa/ladtgub4_user_variables.htm?Highlight=USER_AUDIT

#STD_STRNG := #DATETIMEX.now.AsDisplayString( CCYYMMDDHHMMSS ) + ' T19_ServerSystemManager ' + #PersistentString1.AsNativeString
Insert Fields(#STD_STRNG) To_File(TESTLOG)

Define Field(#tempuser) Type(*CHAR) Length(10)
Define Field(#temppass) Type(*CHAR) Length(32) Input_Atr(LC)
#tempuser := #PersistentString1.AsNativeString.UpperCase
#temppass := #PersistentString2.AsNativeString
Call Pgm(TESTCHGJOB) Parm(#tempuser #temppass)
and this is the status of the testchgjob CL which calls the API:

Code: Select all

PGM (&USERPROF &PASSWORD)                                          
                                                                   
/* RECEIVED PARMS */                                               
DCL        VAR(&USERPROF) TYPE(*CHAR) LEN(10)                      
DCL        VAR(&PASSWORD) TYPE(*CHAR) LEN(32)                      
DCL        VAR(&CHANGEJOB) TYPE(*CHAR) LEN(1)                      
DCL        VAR(&CHANGELIBL) TYPE(*CHAR) LEN(1)                     
DCL        VAR(&HANDLE) TYPE(*CHAR) LEN(12)                        
                                                                   
/* RETURNED PARMS */                                               
DCL        VAR(&RETCODE) TYPE(*CHAR) LEN(2)                        
DCL        VAR(&ERRORMSG) TYPE(*CHAR) LEN(132)                     
                                                                   
DCL &SQLSTMT TYPE(*CHAR) LEN(1000)                                 
DCL &QUOTE *CHAR 1 VALUE('''')                                     
                                                                   
             CHGVAR     VAR(&PASSWORD) VALUE(%TRIM(&PASSWORD))     
             CHGVAR     VAR(&SQLSTMT) VALUE('INSERT INTO TESTLOG + 
                          (STD_STRNG, @@UPID)' || ' VALUES(' || +  
                          &QUOTE || &USERPROF || &PASSWORD || +        
                          &QUOTE || ', 1)')                            
                 SNDPGMMSG &SQLSTMT                                    
             RUNSQL     SQL(&SQLSTMT) COMMIT(*NONE)                    
             MONMSG CPF0000                                            
             CALL       PGM(CHGJOBUSR) PARM(&USERPROF &PASSWORD Y N +  
                          &HANDLE &RETCODE &ERRORMSG)                  
             CHGVAR     VAR(&SQLSTMT) VALUE('INSERT INTO TESTLOG +     
                          (STD_STRNG, @@UPID)' || ' VALUES(' || +      
                          &QUOTE || &RETCODE || &ERRORMSG || &QUOTE +  
                          || ', 1)')                                   
                 SNDPGMMSG &SQLSTMT                                    
             RUNSQL     SQL(&SQLSTMT) COMMIT(*NONE)                    
             MONMSG CPF0000                                            
             WRKSPLF    OUTPUT(*PRINT)                                 
                                                                       
ENDPGM                                                                                           
                          
I dont see a problem with the LANSA code, the thing to find is how to receive the password correctly for the API... will play more with this later. maybe length of the parm, or something else with the trim, but the value is been received correctly in the CL.
If you try with this code, the TESTLOG have only one field, STD_STRNG, and you may want to do a CLRPFM TESTLOG before try each run.

User avatar
Dino
Posts: 134
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Frameworks and IBMi user profile

Post by Dino » Thu Jun 10, 2021 2:58 am

and now is working.

Code: Select all

20210609175727 T19_LOGONVALIDATION g14raultst    
20210609175735 T19_ServerSystemManager g14raultst
G14RAULTSTtemporal                               
OK                                               
you need to use 128 as length for the password in the server system manager for my temporary #TEMPPASS field:

Code: Select all

Use Builtin(SET_SESSION_VALUE) With_Args(USER_AUDIT #PersistentString1.AsNativeString)
* https://%lansadocs%/lansa015/index.htm#lansa/ladtgub4_user_variables.htm?Highlight=USER_AUDIT

#STD_STRNG := #DATETIMEX.now.AsDisplayString( CCYYMMDDHHMMSS ) + ' T19_ServerSystemManager ' + #PersistentString1.AsNativeString
Insert Fields(#STD_STRNG) To_File(TESTLOG)

Define Field(#tempuser) Type(*CHAR) Length(10)
Define Field(#temppass) Type(*CHAR) Length(128) Input_Atr(LC)
#tempuser := #PersistentString1.AsNativeString.UpperCase
#temppass := #PersistentString2.AsNativeString
Call Pgm(TESTCHGJOB) Parm(#tempuser #temppass)
as is in the original CL provided by LANSA for the parameter received &PASSWORD. In my reduced CL pgm you need to change password to 128 as well for the parameter received &PASSWORD:

Code: Select all

 0001.00 PGM (&USERPROF &PASSWORD)                        
 0002.00                                                  
 0003.00 /* RECEIVED PARMS */                             
 0004.00 DCL        VAR(&USERPROF) TYPE(*CHAR) LEN(10)    
 0005.00 DCL        VAR(&PASSWORD) TYPE(*CHAR) LEN(128)   
It is working fine. I can see the WRKSPFL sending the result to G14RAULTST (or the user I logon to the VLF) instead of the default user associated with the LWEB_JOB's.

ESODevKJ
Posts: 30
Joined: Tue Nov 10, 2020 9:07 am

Re: Frameworks and IBMi user profile

Post by ESODevKJ » Tue Jun 15, 2021 4:40 am

Hi Dino,

I'm all caught up with what you've done. I am stuck at same spot, i.e., the password being passed is correct, but keep getting the invalid password error message and retcode. Tried debugging CL program and manually changing password field and still same issue.

I also noticed, maybe it's just the way my company has IBMi setup, but when logging into as400 or frameworks, does not matter if you use capital or lowercase letters - password is accepted either way. Makes it even more strange that the error message keeps returning an invalid password.

Thanks.

User avatar
Dino
Posts: 134
Joined: Fri Jul 19, 2019 7:49 am
Location: Robbinsville, NC
Contact:

Re: Frameworks and IBMi user profile

Post by Dino » Tue Jun 15, 2021 5:22 am

Notice that if you get that error is in the API. I kept having it for a few trial runs, double check:

- try to call the api directly from the command line (use the reduced one with 2 parameters), use ' ' around the password when doing the call, this step should work perfectly before the next.
- check that fields passed thru the components are the same length, if one of the fields in the middle is different length, you will get some trashy characters in the final string received for the api.
- my particular install makes a difference between lowercase and uppercase when i logon in the vlf, the api it is strict on that, so not making my password lowercase, but been sure that the fields where you store the password have the LC attribute to support lowercase characters.
- check that the user is not disabled, it will happen after a few wrong tries.

Post Reply