2-way authorization

2-way authorization with a key request

Before a map request can be made a key request has to be done first.


1. Key request: GET → http://maps1.locr.com/?get_auth_key=true

2. Answer (key): "XXXXXXXXXX"

3. Token assembling: token = md5(md5("PASSWORD") + "XXXXXXXXXX") => "YYYYYYYYYY"

4. Request: http://maps1.locr.com/?username=USERNAME&key=XXXXXXXXXX&token=YYYYYYYYYY&latitude_min=36&longitude_min=12&latitude_max=38&longitude_max=15&width_cm=10&height_cm=10&map_config=202

Please note that the key and token are string representations of the MD5 hash result. Also the md5("PASSWORD") is a string. I.e. you have to convert the hashes to strings before the token value can be assembled.