< Previous by Date Date Index Next by Date >
  Thread Index Next in Thread >

[repro-users] Issue in database integration with Repro


Hi,

 

  I am trying to integrate MySql with repro. I am able to create the database and create tables as well.

  But the problem started when I tried to populate the “users” table. Below are the steps that I tried

 

 Step 1) mysql -u repro REPRO -e "CREATE TABLE users (user VARCHAR(30) NOT NULL, domain VARCHAR(30), realm VARCHAR(30), passwordHash VARCHAR(40), name VARCHAR(40), email VARCHAR(50), forwardAddress VARCHAR(80), UNIQUE INDEX index1 (user, domain) )"

 

 Step 2) wrote a shell script to populate values: below is the snippet

     

  #!/bin/sh

 

 for ((  i =1  ;  i <=2;  i++  ))

do

  mysql -u repro repro -e "INSERT INTO users ( user, domain, passwordHash ) VALUES ('alice$i', '10.0.16.30', ‘alice$i’)"

done

 

Step 3) select * from users;

 

Step 4) The result of the above command is something like below.

+--------+------------+------------+----------------------------------+-------+-------+----------------+

| user   | domain     | realm      | passwordHash                     | name  | email | forwardAddress |

+--------+------------+------------+----------------------------------+-------+-------+----------------+

| admin  |            |            | b80648545a30e0999892b517127c0e17 |       |       |                |

| | alice0 | 10.0.16.30 | NULL       | alice0                           | NULL  | NULL  | NULL           |

| alice1 | 10.0.16.30 | NULL       | alice1                           | NULL  | NULL  | NULL           |

| alice2 | 10.0.16.30 | NULL       | alice2                           | NULL  | NULL  | NULL           |

| alice3 | 10.0.16.30 | NULL       | alice3                           | NULL  | NULL  | NULL           |

| alice4 | 10.0.16.30 | NULL       | alice4                           | NULL  | NULL  | NULL           |

| alice5 | 10.0.16.30 | NULL       | alice5                           | NULL  | NULL  | NULL           |

+--------+------------+------------+----------------------------------+-------+-------+----------------+

 

Step 5) When I then try to register a user with name “alice0” and password “alice0”, I get an error saying “403 wrong password” and sometimes “404 User not found”.

 

Step 6) But when I really populate the values from a Web interface “REPRO HTTP web interface” the above mentioned issues does not arise. And more over password is getting stored in an encrypted manner something like below:

 

alice0 | 10.0.16.30 | 10.0.16.30 | 8017ee6b8e82d42d422ddf7c6695eacb |       |       |                |

| alice1 | 10.0.16.30 | 10.0.16.30 | f8e92a59c86287a8a0916edf484ec841 |       |       |                |

| alice2 | 10.0.16.30 | 10.0.16.30 | 9b7a6c5c7f0d0e2519163d74e29dfb6e |       |       |                |

| alice3 | 10.0.16.30 | 10.0.16.30 | 92308819d79f892884863c8571730ee9 |       |       |                |

| alice4 | 10.0.16.30 | 10.0.16.30 | 8967918e7dc7df2aead3053bd8be4533 |       |       |                |

| alice5 | 10.0.16.30 | 10.0.16.30 | 3b6b71fa27910509c3163d0b4bd1e025 |       |       |                |

 

What I understand is when database insert is made some kind of hashing or encrypting is done, so please help me whether in the first place can I do a database insert command to manually insert values into the database rather than using HTTP interface. If inserting manually using database commands is fine, is the above mentioned database insert command correct?

 

Please help me solve the issue.

 

Thanks and Regards,

-Sandeep A