AS/400: Create a program that is invoked on using the command CHGPWD

125 pts.
Tags:
AS/400
CHGPWD
Hi, I am new to AS/400 and I would like to create a program that is invoked on using the command CHGPWD. How can I do that?


Software/Hardware used:
AS400
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Are you looking to do something like updating login tables when ever a user changes their password? Maybe for a network connection to a DB2 database? 

Discuss This Question: 15  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • azohawk
    You would need to use an exit program. There are entire books written on this topic. You can also search on this site for EXIT PROGRAMS and find some information.  
    4,055 pointsBadges:
    report
  • pdraebel
    Exit point name is QIBM_QSY_CHK_PASSWRD. Use command WRKREGINF to register the program that needs to be invoked.
    The program needs to accept a fixed list of parameters. More info can be found in the IBM Knowledge Center
    7,545 pointsBadges:
    report
  • ToddN2000
    What type of program are you looking to run? The other methods listed should suit your needs. There may be other alternatives but not knowing the full scope we are making educated guesses.
    135,305 pointsBadges:
    report
  • Pranav0712
    Thank you azohawk, pbraebel, ToddN2000. I will read more about the exit programs and try to achieve my objective.
    I wanted to capture the password once the chgpwd command is fired and then send it to my custom java code for some further processing.
    125 pointsBadges:
    report
  • bvining

    As you are interested in capturing the password when it's changed (which can be done with more commands than just ChgPwd) you may want to look at the Check Password Exit Program at http://www-01.ibm.com/support/knowledgecenter/api/content/nl/en-us/ssw_ibm_i_71/apis/xsyckphr.htm

    Bruce Vining


    7,070 pointsBadges:
    report
  • ToddN2000
    Your best bet is to use the exit program method mentioned. Like bvining said CHGPWD is not the only way to change a password. Depending on the user and their authority, you can change a password by WRKUSRPRF. We use this a lot when a user tries 3 times to log in and fails and disables their profile and we need to reset it.
    135,305 pointsBadges:
    report
  • Pranav0712
    Thanks Bruce.. There was a lot of learning there. Finally understood the difference between QIBM_QSY_VLD_PASSWRD and QIBM_QSY_CHK_PASSWORD.
    125 pointsBadges:
    report
  • Pranav0712
    I have been trying to register my java program to the "QIBM_QSY_CHK_PASSWORD" exit point but am unable to do so. Somehow it is not able to find the program. I tried placing the program in QGPL lib and still it was not able to find it. This is one problem.
    Another problem is that when I was going through the Format of Check Password Exit Information and found out that the passwords are provided as a pointer information. Does that mean that I would need to write the password capture program in C and then pass it to my java class?
    125 pointsBadges:
    report
  • pdraebel
    I was trying to check if there were any language restrictions for Exit points. Could not find JAVA as valid language, so I would guess you need to encapsulate the JAVA call in a HLL language oniSeries.
    7,545 pointsBadges:
    report
  • Pranav0712
    Thanks. Can it be done by writing an RPG?
    125 pointsBadges:
    report
  • pdraebel
    Should be possible, RPGLE that is. Have also seen examples fo C programs used as Exit programs.
    7,545 pointsBadges:
    report
  • ToddN2000
    I'm not sure if you can capture the new password. I may be wrong. When our security officer gets a call from a user who forgot their password we can not see it. We can only assign a new one. I'd be curious if this is possible as it seem like a security flaw. You could be setting up a backdoor program to gain access to any profile on the system.
    135,305 pointsBadges:
    report
  • Pranav0712
    This is indeed possible. I know a couple of programs that give password intercept facility. I mean they give you a means to synchronize passwords for a particular user across multiple systems if the password is changed on any one. That means they do dig out the new password on the event of a password change and then propagate it to the sub systems involved.
    125 pointsBadges:
    report
  • ToddN2000
    I'll have to look into it. I work on 4 different i-Series machines and have to reset my password on each of them every 60 days. It would be nice to do it once and have it update all. I most likely could only test my profile as I have no authority to the other profiles or the command to CHGPWD.
    135,305 pointsBadges:
    report
  • Pranav0712
    Thank you guys... I finally was able to finish it off with a C code. Couple of issues still remain but I think will somehow manage to finish it off.
    125 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: