RPC authentication & authorisation

I have read https://mongoose-os.com/docs/mongoose-os/userguide/security.md and try to add authentication & authorisation to my project. I use this commands


htdigest -c rpc_auth.txt myproduct joe
mos put rpc_auth.txt
mos config-set rpc.auth_domain=myproduct
mos config-set rpc.auth_file=rpc_auth.txt
mos put rpc_acl.json
mos config-set rpc.acl_file=rpc_acl.json

to create credentials and put files to ESP32
My rpc_acl.json have next text:

[
  {"method": "FS.*", "acl": "+joe,-user2"}
]

The commands like mos ls -l --rpc-creds=joe:11111 work well,
but , I have not found , how to include auth key in RPC request.
My questions are:

  1. How to use htdigest authentication & authorisation with mdash
  2. How to add auth key in RPC request
1 Like

AFAIK, mDash does not support htdigest authentication & authorisation.

RPC request with auth:

curl --digest http://user:pass@IP/rpc/FS.ListExt
[{"name": "ca.pem", "size": 27949},{"name": "index.html", "size": 70},{"name": "rpc_acl.json", "size": 86},{"name": "test.js", "size": 1346},{"name": "conf0.json", "size": 3},{"name": "rpc_auth.txt", "size": 47},{"name": "conf9.json", "size": 303}]
1 Like