vForums Support Banner



 

Welcome Guest! Please Login or Register
vForums Support :: vForums :: Support :: API: Password Check - View Topic
Topic Rating: *****
Reply Printable View
Broken
Senior Member
****

[Avatar]
Lost Resolve

Posts: 1,741
Status: Offline
Gender: Male
Age: 18
Joined:  
Reputation: 22%  


pmtwitterskypemsnyahooaim
API: Password Check (2nd Feb 10 at 12:45am EST)Quote Reply
Ross,

I have been trying to do an account check in my store system to verify the user make the purchase is the person logged into the account, there is one big problem {Unsure} I have no idea how to do a password check since you hashed the passwords {Unsure} this is what i am currently using:

Code:
 
  1. if($_POST['username'] != $user_info['user_name'] || $_POST['password'] != $user_info['password'] || !$_POST['username'] || !$_POST['password']){
 


Only think I can think of is hashing the $_POST['password], but i honestly have no idea if they would has exactly the same. I'm assuming your using md5.

So any idea on how to go about getting this done?

If you fall I’ll catch, if you love I’ll love, And so it goes, my dear, don’t be scared, you’ll be safe,
This I swear. If you only love me back.

Image
Ross
Administrator
*****

[Avatar]

Posts: 3,429
Status: Offline
Age: 22
Joined:  

Additional Groups:
Support Team
***


Reputation: 67%  


pmwwwtwittermsngtalk vForum
Re: API: Password Check (2nd Feb 10 at 4:40am EST)Quote Reply
Unfortunately we cannot reveal how our passwords are hashed. And may even change how it's done at some point in the future to improve security.

The only way to validate the password a user provides is to run it through the login_user() function. That will post it to our server which will handle hashing it and comparing it to the password in the database.


Broken
Senior Member
****

[Avatar]
Lost Resolve

Posts: 1,741
Status: Offline
Gender: Male
Age: 18
Joined:  
Reputation: 22%  


pmtwitterskypemsnyahooaim
Re: API: Password Check (2nd Feb 10 at 5:08am EST)Quote Reply
Ok i understand the security aspect, also i don't mind if it has to check the password on your end and not completely on mine which is why i tried using $user_info['password']. Anyways how would i go about running it through the login_user() function? Well the better question is, is the login_user() function an array? If it is i can can take it from there.


Edit: Ok i think i figured it out, i looked over the API again and seen how it was setup, and based on what i've been before, this should work, i hope:

$passval = $vf -> login_user($pass = 'pass');



Edit 2:

Clearly my PHP still still need work {Unsure} This is what I am using and its not working, and suggestions?

Code: PHP
 
  1. $username = $_POST['username'];
  2. $password = $_POST['password'];
  3. $vf_pass = $vf -> login_user($pass = 'pass');
  4.                  
  5. if($username != $user_info['user_name'] || $password != $vf_pass || !$username || !$password){
 


the default username and email id's are set to user and pass so part should be fine


If you fall I’ll catch, if you love I’ll love, And so it goes, my dear, don’t be scared, you’ll be safe,
This I swear. If you only love me back.

Image
 Reply Printable View

All times are GMT+0 :: The current time is 5:48am
Page generated in 0.2756 seconds
with 28 Database Queries and 0 cache files
This Forum is Powered By vForums (v2.3)
Create a Forum for Free | Find Forums