N0RUA
Hello!
I'm attempting to use the HTTP API, and I'm getting an HTTP 401 Unauthorized after digesting the token and password.
Given the token "22b49ca2", and the password "openspot", I'm doing something similar to this ruby code:
Digest::SHA256.hexdigest("22b49ca2openspot").downcase
This results in the final digest: 10f4aa5f8fd05c04258e83a80b14de4973d2e5cbbf24dc1f6354caa7290effd1
When I HTTP POST the following JSON payload to my openspot, I get HTTP 401:
$ curl -vvvv http://openspot.local/login -H "Content-Type: application/json" -H "Accept: application/json" -d @data.json
* Trying 192.168.1.250...
* TCP_NODELAY set
* Connected to openspot.local (192.168.1.250) port 80 (#0)
> POST /login HTTP/1.1
> Host: openspot.local
> User-Agent: curl/7.58.0
> Content-Type: application/json
> Accept: application/json
> Content-Length: 99
>
* upload completely sent off: 99 out of 99 bytes
< HTTP/1.1 401 Unauthorized
< Connection: close
< Server: SharkRF httpsrv
< Access-Control-Allow-Headers: Authorization, Origin, X-Requested-With, Content-Type, Accept
< Access-Control-Allow-Origin: *
<
* Closing connection 0
data.json contains a single line containing:
{"token": "22b49ca2", "digest": "10f4aa5f8fd05c04258e83a80b14de4973d2e5cbbf24dc1f6354caa7290effd1"}
Any thoughts? I had this basic code working with my old openspot 1 (using the .cgi extensions), but something seems to be different with the openspot 2 this time around.