Request digest auth returning 401-Unauthorized Access.
See original GitHub issueSummary
Request digest auth returning 401-Unauthorized Access.
Simplest Example to Reproduce
var options = {
method: 'POST',
uri: this._uri,
body: {
method: procedureName,
params: postParams,
id: 'jsonrpc',
auth: {
user: 'vv',
pass: 'pass',
sendImmediately: false
}
},
json: true
}
Current Behavior
Doing cURL works:
curl -X POST http://138.197.140.16:5001/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"make_integrated_address","params":{"payment_id":""}}' -H 'Content-Type: application/json' -u vv:pass --digest -v
* Trying 138.197.140.16...
* Adding handle: conn: 0x7fd1eb80cc00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fd1eb80cc00) send_pipe: 1, recv_pipe: 0
* Connected to 138.197.140.16 (138.197.140.16) port 5001 (#0)
* Server auth using Digest with user 'vv'
> POST /json_rpc HTTP/1.1
> User-Agent: curl/7.30.0
> Host: 138.197.140.16:5001
> Accept: */*
> Content-Type: application/json
> Content-Length: 0
>
< HTTP/1.1 401 Unauthorized
* Server Epee-based is not blacklisted
< Server: Epee-based
< Content-Length: 98
< Content-Type: text/html
< Last-Modified: Wed, 29 Nov 2017 07:40:38 GMT
< Accept-Ranges: bytes
< WWW-authenticate:Digest qop="auth",algorithm=MD5,realm="monero-rpc",nonce="By+1q6zvkmFdCNnt+bMR7A==",stale=false
* Ignoring duplicate digest auth header.
< WWW-authenticate:Digest qop="auth",algorithm=MD5-sess,realm="monero-rpc",nonce="By+1q6zvkmFdCNnt+bMR7A==",stale=false
<
* Ignoring the response-body
* Connection #0 to host 138.197.140.16 left intact
* Issue another request to this URL: 'http://138.197.140.16:5001/json_rpc'
* Found bundle for host 138.197.140.16: 0x7fd1ead11e20
* Re-using existing connection! (#0) with host 138.197.140.16
* Connected to 138.197.140.16 (138.197.140.16) port 5001 (#0)
* Adding handle: conn: 0x7fd1eb80cc00
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x7fd1eb80cc00) send_pipe: 1, recv_pipe: 0
* Server auth using Digest with user 'vv'
> POST /json_rpc HTTP/1.1
> Authorization: Digest username="vv", realm="monero-rpc", nonce="By+1q6zvkmFdCNnt+bMR7A==", uri="/json_rpc", cnonce="ICAgICAgICAgICAgICAgICAgICAgIDE1MTIzNjkzODE=", nc=00000001, qop=auth, response="0e3460e7cde1e082a8c0819a4638ea58", algorithm="MD5"
> User-Agent: curl/7.30.0
> Host: 138.197.140.16:5001
> Accept: */*
> Content-Type: application/json
> Content-Length: 88
>
* upload completely sent off: 88 out of 88 bytes
< HTTP/1.1 200 Ok
* Server Epee-based is not blacklisted
< Server: Epee-based
< Content-Length: 234
< Content-Type: application/json
< Last-Modified: Wed, 29 Nov 2017 07:40:39 GMT
< Accept-Ranges: bytes
<
{
"id": "0",
"jsonrpc": "2.0",
"result": {
"integrated_address": "4KWhv7EQyhNBrSkigZXgJA9ytc4ZfY8tnPCchuXFPVgT3f8BrfW533M6nCeNY8CrJmaXvWzeejRrQ2XxqeWMxUoMNbnkvLGF4LxFnPCk55",
"payment_id": "2306a37c827cb183"
}
* Connection #0 to host 138.197.140.16 left intact
}%
Your Environment
software | version |
---|---|
request | 2.83.0 |
node | 6.8.0 |
npm | 4.0.3 |
Operating System | OS X 10.9.5 |
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
401 Unauthorized - HTTP - MDN Web Docs
The HyperText Transfer Protocol (HTTP) 401 Unauthorized response status code indicates that the client request has not been completed ...
Read more >401 Error: 5 Ways to Troubleshoot and Fix It - Hostinger
The 401 Unauthorized error is triggered by unauthenticated requests made to a WordPress web server. Learn how to identify and fix the issue....
Read more >How to Quickly Fix the 401 Unauthorized Error (5 Methods)
The 401 (Unauthorized) status code indicates that the request has not been applied because it lacks valid authentication credentials for the ...
Read more >How to Fix a 401 Unauthorized Error? - GeeksforGeeks
It may be represented as 401 Unauthorized, Authorization required, HTTP error 401- Unauthorized. It represents that the request could not be ...
Read more >401 Unauthorized - Evert Pot
When a client makes a HTTP request, but the server requires the request to be authenticated a 401 Unauthorized status is returned.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
https://github.com/request/request/issues/2388
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.