There is an i5/OS API that validate a user id an password for the purpose of
being able to run jobs under different user ids.
Check out this link from the IBM site:
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/QSYGET
PH.htm
I'm don't have program source for you - but I suggest the following logic:
1. Create a prompt for user id and password.
2. Make sure that the user id doesn't start with '*' (see the link above)
3. Call the API (if you haven't called API's before, then check out the
examples from the IBM web site)
4. Check if any error returned from the call to the API.
5. If no errors, then the user login was good.
I'm not sure if this is the best method, but I think in the absence of other
suggestions, it might be a good place to start.
Question: If the user id entered is different than the one that you started
with, do you expect your job to continue under the new user id? If so, then
another API to check out is
http://publib.boulder.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/QWTSET
P.htm This will take the 'handle' returned by QSYGETPH API and change the
current job's user id to the new user id.
At least, that's how I'm reading it. Let us know what you ended up with!
James
-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of Ashish Kulkarni
Sent: Sunday, March 23, 2008 9:44 PM
To: RPG400-L@xxxxxxxxxxxx
Subject: Authenticate As400 user id password
Hi
I have a requirement where in i have to show a user a window on AS400 with
him user id and ask him to enter his password,
then authenticate to see if the password is valid,
I have to do it using RPGLE or CL any ideas how to do it.
can i have any sample program to do so
Ashish
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.