-
-
Notifications
You must be signed in to change notification settings - Fork 90
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
401 Unauthorized Error #168
Comments
Please paste full output of |
faster-than-requests debugs(): |
On your request the Auth info goes into the Body ? or into the Header ?. The latest version of the compiler is |
This probably holds the answer for debugging this, the tcpdumps of each. Looks like it's being added to the header if I'm reading these right? Something that looks very interesting is that yours does not contain the "Authorizations" tag that requests does. (I cut out a few lines to make sure I'm not giving away a password) 0x00f0: 6774 683a 2035 390d 0a41 7574 686f 7269 gth:.59..Authori REQUESTS (which works) sudo tcpdump -X -i ens192 host 10.10.0.18 FASTER-THAN-REQUESTS sudo tcpdump -X -i ens192 host 10.10.0.18 |
Can't make same request via postman or insomnia because it's on a server that I have to ssh into and only have command line access. However, I can make the request with curl and it works. Working on recreating it and will send through tcpdump too Also something I filtered out but probably relevant and not a big deal to share: it's using json-rpc |
Correct, it does not auto-inject anything into the headers. You have to pass headers explicitly, kinda like:
There "user" and "password" go Base64'ed. I did not invent this, this is just how it works. |
Ok, I see. Figured it would take care of it like requests does, though this is made for speed and from that point of view, I'm glad it doesn't as it'd have to recalculate every single time. Base64'd, good to know. Might be good to add that as a comment somewhere as I'm sure I won't be the last one to try to send a request that requires username/pass Thank you. It is now working, thank you again Juan! |
I've managed to get faster than requests running on Centos after compiling it myself, but when I post the same data to the same url using the same method as I use for python's normal request library.. I get an unauthorized error with this one.
using requests:
using faster than requests:
Unfortunately for security and confidentially reasons I can't share the url or payload.
But URL is in the form:
http://:@:
Payload is a number of json key-value pairs similar to:
{"method": "", "params": [], "": ""}
It appears this error for this application 401 Unauthorized Error should only be thrown if the username or password are incorrect, but I'm posting to the exact same url in both cases. Do I need to handle things differently for faster than requests?
Edit: The specific error I get returned minus a few hidden fields:
['', 'text/html; charset=ISO-8859-1', '401 Unauthorized', '1.1', 'http://:@:', '0', '{"content-length": @["0"], "content-type": @["text/html; charset=ISO-8859-1"], "date": @["Thu, 10 Jun 2021 16:50:59 GMT"], "www-authenticate": @["Basic realm=\"\""]}']
@juancarlospaco And Juan, I LOVE this library, so don't take this as a compliant, but might be nice to have a short guide that explains how to translate from 'requests' to 'faster-than-requests'.
The text was updated successfully, but these errors were encountered: