kimai/kimai-mobile — Issue #1: Wrong POST content format
Author: toco
Created: 2012-02-21 12:18:15+00:00
State: open

The current Version of Kimai Mobile sends an URL-encoded string with the parameters,
but the API expects an JSON-RPC.

With Kimai-Mobile:
[Tue Feb 21 13:07:54 2012] [error] [client 192.168.1.40] POST: method=authenticate&id=authenticate¶ms%5Busername%5D=admin¶ms%5Bpassword%5D=mySuperSecret, referer: http://example.com:5462/mobile/
[Tue Feb 21 13:07:54 2012] [error] [client 192.168.1.40] PHP Fatal error: Uncaught exception 'Zend_Json_Exception' with message 'Decoding failed: Syntax error' in /Library/Server/Web/Data/Sites/kimai/core/libraries/Zend/Json.php:93\nStack trace:\n#0 /Library/Server/Web/Data/Sites/kimai/core/libraries/Zend/Json/Server/Request.php(251): Zend_Json::decode('method=authenti...')\n#1 /Library/Server/Web/Data/Sites/kimai/core/libraries/Zend/Json/Server/Request/Http.php(53): Zend_Json_Server_Request->loadJson('method=authenti...')\n#2 /Library/Server/Web/Data/Sites/kimai/core/core/json.php(88): Zend_Json_Server_Request_Http->__construct()\n#3 {main}\n thrown in /Library/Server/Web/Data/Sites/kimai/core/libraries/Zend/Json.php on line 93, referer: http://example.com:5462/mobile/

'Manually' sent POST:
[Tue Feb 21 13:08:48 2012] [error] [client 192.168.1.40] POST: {"jsonrpc": "2.0",\n"method": "authenticate",\n"params": {"username": "admin",\n\t\t\t"password": "mySuperSecret"},\n\t\t\t"id": 3}\n

Response:
{"result":"66ac0e03f587d3e091d116316","id":"3","jsonrpc":"2.0"}