Author Topic: User database Integration  (Read 5760 times)

shadyvb

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
User database Integration
« on: September 06, 2009, 09:56:30 am »
I'm making a side microblogging application for a company that uses opengoo, and it is requested to have the same usernames and passwords in the two applications ..

i have access to the db , but i do not know how the password is hashed ..

will anyone help, i need to know how opengoo checks the password ?

shadyvb

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: User database Integration
« Reply #1 on: September 06, 2009, 10:52:35 am »
I've figured it out,

$verif= ($salt_from_db.$pass_from_input)===($token_from_db)

ivanl

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: User database Integration
« Reply #2 on: April 07, 2010, 05:16:43 pm »
I also have this problem, thanks for answer you helped me that I new where to search.
I have one portal and I included this super duper feng office in it. When I add new user to a portal, he has the same password like on fengoffice.

Code to generate password for feng office:

First you have to calculate  value for field token in users table then calculate users password from token at the end insert all values in to a table.
Example:

Code: [Select]
<?
$salt = substr(sha1(uniqid(rand(), true)), rand(0, 25), 13);

$input_password = "mypassword";
$token =  sha1($salt. $input_password);

INSERT INTO `og_users` (`id`, `company_id`, `personal_project_id`, `username`, `email`, `token`, `salt` ) VALUES
(1, 1, 1, 'test_user', 'email@gmail.com', '$token', '$token')

?>

I hope I helped you someone who search for this question!

Regards, Ivan
« Last Edit: April 07, 2010, 05:53:41 pm by ivanl »