|
You could also try the CHKPWD command; The Check Password (CHKPWD) command checks a password for the user running the command and determines its validity. If the password is correct, no message is sent. If the password not correct, one of the error messages listed below is sent after each attempt. The password is the security key that allows a user to sign on to the system. Error messages for CHKPWD *ESCAPE Messages CPF2362 Password not correct. CPF2363 Only 1 attempt left to check password. CPF2364 Maximum number of attempts to check password reached. Thanks Dennis Nel Technical Consultant: AS/400 * DNel3@oldmutual.com <mailto:Dnel3@oldmutual.com> * (021) 509-3459 * (082) 808-2687 -----Original Message----- From: Jim Langston [mailto:jlangston@celsinc.com] Sent: 23 August 2001 05:29 To: rpg400-l@midrange.com Subject: RE: Password Check Routine Myself, I use the Change User Password QSYCHGPW for this. It's just easier for me to use. I just attempt to set the new password to the current password and look at the error code. If the password is the existing password, no error is returned, and nothing is really done, since the password is changed to itself. If the password supplied doesn't match, then the error code will indicate this. Seems to be the most straight forward of the security APIs for checking a user password to me. Unfortunately, I don't have a code snippet since it was at another company where this was used. Change User Password (QSYCHGPW) API 1 User ID Input Char(10) 2 Current password Input Char(10) 3 New password Input Char(10) 4 Error code I/O Char(*) Regards, Jim Langston Programmer/Analyst Cels Enterprises, Inc. -----Original Message----- From: rpg400-l-admin@midrange.com [mailto:rpg400-l-admin@midrange.com]On Behalf Of Carsten Flensburg Sent: Thursday, August 23, 2001 1:20 AM To: rpg400-l@midrange.com Subject: Re: Password Check Routine Hello Tim, Check out the QSYGETPH (Get Profile Handle) API - it'll do what you want... Best regards, Carsten Flensburg ----- Original Message ----- From: <rpg400-l-admin@midrange.com> To: <rpg400-l@midrange.com> Sent: Thursday, August 23, 2001 1:32 AM Subject: Password Check Routine > Does anybody have a rpg snippet, that would allow me to verify a username > and password, and check it against the as/400 logon password file? > > I have seen this discussion before, and it's ok, if the failed password > attempt gets updated on a failed attempt... It's going to be used in a web > app, but I didn't want to use a protective block directive for this... > > Thanks, tim _______________________________________________ This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/rpg400-l or email: RPG400-L-request@midrange.com
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.