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

Re: [repro-devel] [repro-users] Issue in database integration with Repro


Hi Sandeep,

The "passwordHash" is the value of the "A1" hash in RFC 2617 (see section 3.2.2.2) which contains the username, password, and relam. The realm row in the database has to be filled in as well. When you actually use the proxy server, you will probably want the domain and the realm to be a name in DNS. For example, if you setup DNS correctly in the velankani.com domain for registrations to be sent here:
sip:repro.velankani.com

the domain and the realm would both be repro.velankani.com.

If I have an account with username "rohan" and password "secret" then A1 would be the MD5 hash of:
rohan:repro.velankani.com:secret
and you would store the base64 encoding of that MD5 hash in the database.

Hope this helps.
thanks,
-rohan


On May 19, 2008, at 5:41 AM, Sandeep Ammaladinna wrote:
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



_______________________________________________
repro-users mailing list
repro-users@xxxxxxxxxxxxxxx
https://list.resiprocate.org/mailman/listinfo/repro-users