[luci] JSON RPC access

jonsmirl at gmail.com jonsmirl at gmail.com
Fri Sep 6 07:58:15 CEST 2013


Why doesn't this work? I get an auth token. But no matter what I do
with it I get a 403.
Using openwrt git.

jonsmirl at terra:/home/apps/openwrt$ curl -i -X POST -d '{"jsonrpc":
"2.0", "method": "login", "params": { "user": "root",
"password":"admin"}, "id": 1}'
http://192.168.1.85/cgi-bin/luci/rpc/authHTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json
Set-Cookie: sysauth=8706058a5ea128f7b2fd1ddec9489d0b; path=/
Cache-Control: no-cache
Expires: 0

{"id":1,"jsonrpc":"2.0","result":"8706058a5ea128f7b2fd1ddec9489d0b"}jonsmirl at terra:/home/apps/openwrt$
jonsmirl at terra:/home/apps/openwrt$ curl -i -X POST -d '{"jsonrpc":
"2.0", "method": "dir", "params": [ "/"], "id": 1}'
http://192.168.1.85/cgi-bin/luci/rpc/fs?auth=8706058a5ea128f7b2fd1ddec9489d0b
HTTP/1.1 403 Forbidden
Connection: close
Transfer-Encoding: chunked

jonsmirl at terra:/home/apps/openwrt$


-- 
Jon Smirl
jonsmirl at gmail.com


More information about the luci mailing list