I want to add static user other than admin to get access to certain RPCs.
Currently I used:
uhttpd.main.config=/etc/httpd.conf
and
root@OpenWrt:/# cat /etc/httpd.conf
:admin:$p$admin
:user123:$1$o38FGUqi$qPKdfdsyPrJYstq7Wta.
For this when I use RPC from LAN PC like below:
# curl --insecure -i -X POST http://192.168.0.1/cgi-bin/luci/rpc/auth -d'
{
"method": "login",
"params": [
"admin",
"1g2h3g"
]
}'
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json
Set-Cookie: sysauth=f201c26de92ab2d230583248a5bbfb12; path=/
Cache-Control: no-cache
Expires: 0
{"id":null,"result":"f201c26de92ab2d230583248a5bbfb12","error":null}
I get token but for new user user123 I get different response without token =
# curl --insecure -i -X POST http://192.168.0.1/cgi-bin/luci/rpc/auth -d'
{
"method": "login",
"params": [
"user123",
"1a2b2c"
]
}'
HTTP/1.1 200 OK
Connection: close
Transfer-Encoding: chunked
Content-Type: application/json
Cache-Control: no-cache
Expires: 0
So user has added but authentication is not done. At least token is not issued by uhttpd.
How it can be achieved?
to that next is to limit RPC to this user
Thanks in advance!