Hello People…!! I have a problem here dont know whether to call it small ro big. Anyways, here it is… I have to accept the USERID and PASSOWORD of a user for Authorising a particular transaction, till here its ok working cool. After accepting the userid and password, I need to check whether the USERID exists in the USER table and the entered password matchs the USER table Password. As we all know that the password field is encrypted I need to decrypt it to check it with the accepted password. Does anyone here knows how to Decrypt the Password. Eg. UserTable.Get(EnteredUserID); if Usertable.Password = EnteredPassword then Authorize := true; regards and thanks…
Vishal, use a different approach to this. Instead de-crypting the password, try and en-crypt the password the user enters. Use table 2000000002 User as a temporary table, validate the userid and password, and do the compare on this record to the original entry. Soren Nielsen, moderator Integration/Developer NOLUG
Sorry, let me give you some code:
User.GET(USERID);
tempUser.VALIDATE("User ID",enteredUserID);
tempUser.VALIDATE(Password,enteredPassword);
IF tempUser.Password <> User.Password THEN
ERROR('Wrong password');
Soren Nielsen, moderator Integration/Developer NOLUG Edited by - SNielsen on 2001 Jul 24 16:13:30
This is the logic that I used for something like that, hopefully it will be useful to you NOTE: Both User and TempUser are Record Variables pointing to the User Table. IF User.GET(UID) THEN BEGIN TempUser.“User ID” := UID; TempUser.Password:= Pwd; TempUser.VALIDATE(Password); IF TempUser.Password <> User.Password THEN ValidationStatus := 99 //Password does not match ELSE ValidationStatus := 1 // PASS!!! END ELSE ValidationStatus := 55; // User Not Found EXIT(ValidationStatus) Darren Bezzant Development Specialist dbezzant@csbsystems.com CSB Systems 1560 - 333 11th Avenue SW Calgary, Alberta T2R 1L9 Tel: (403) 233-2955 Fax: (403) 233-2957
Looks Like Soren beat me to the punch. Thats what i get for going for coffee in the middle
Hi Soren,
quote:
User.GET(USERID);tempUser.VALIDATE (UserID,enteredUserID);tempUser.VALIDATE(Password,enteredPassword);IF tempUser.Password <> User.Password THEN ERROR(‘Wrong password’);
Thanks so much for the solution, i already tried this approach, but the problem still exists, after encrypting the EnteredPassord value if you message both the values i.e. User.Get(EnteredUserID); message(’%1 - %2’,Usertable.Password,enteredpassword); they dont appear to be the same so it wont match. Regards Vishal
Not sure why they would not be matching, I just tried it with my setup, it worked fine. Could you supply the code that you are using and maybe something will show up. Cheers Darren Bezzant Development Specialist dbezzant@csbsystems.com CSB Systems 1560 - 333 11th Avenue SW Calgary, Alberta T2R 1L9 Tel: (403) 233-2955 Fax: (403) 233-2957
Hmm, second thought. Dont use a temporary table! And dont do the INSERT.
User.GET(USERID);
User2.VALIDATE("User ID",enteredUserID);
User2.VALIDATE(Password,enteredPassword);
IF User2.Password <> User.Password THEN
ERROR('Wrong password');
it works for me. Just tested it Soren Nielsen, moderator Integration/Developer NOLUG Edited by - SNielsen on 2001 Jul 24 16:47:25
Hello, Thank you so much all of you for your support and time. I was finally able to get it, with the following code. Instead of user.get(userid) i have to use user.get(EnteredUserID) as the Authorization will be done by some 3 Person
[quote]
User.GET(EnteredUserID); User2.VALIDATE(User2.“User ID”,EnteredUserID); User2.VALIDATE(User2.Password,Pwd); IF User.Password <> User2.Password THEN ERROR(‘Wrong password’) else error(‘Correct Password’); [\quote] Thank you all once again… I love this place… Edited by - vshal on 2001 Jul 24 17:03:42
vshal,
i’m facing some problem like you, i need to check the entered password match the user table password,
but the password is encrypted in user table password, my question is what encryption is used by nav? and do you have the encryption method?
because from source code above doesn’t include encryption method.
tq,
Felix