-
Notifications
You must be signed in to change notification settings - Fork 285
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Fix Authorization
header generation
#498
base: master
Are you sure you want to change the base?
Conversation
Fixes `Authorization` header generation to include the query parameters (if present). This brings the implementation inline with MacOS, and fixes digest auth with certain picky services.
It looks like the one failing check is caused by an unrelated bug in libdispatch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The original implementation here was based on RFC2617, which allowed (in section 3.2.1) the URI field to be either absoluteURI or abs_path (and abs_path was chosen, probably because it's simpler), where abs_path does not include the query string.
However, I agree with your diagnosis that the latest/current RFC7616 (section 3.4) has changed this, and abs_path is no longer allowed because that choice of two possibilities is replaced by 'Effective Request URI', and the old abs_path is not valid as an effective request uri.
It seems to me that your patch is a partial but incomplete fix, because my reading of the RFCs is that the new value should be a complete absolute URL, not just path plus query string. As such I think GSHTTPAuthentication should probably be changed to use the scheme, host and port information from the protection space to construct a full URL. Does that work for your application?
I guess there is also a small chance that the format demanded by the new RFC may not work with some old servers, but we can probably ignore that (or add some option to control the format if it does turn out to be a problem).
That being said, I just looked at the curl source code (I think Apple use libcurl). |
The RFCs are a bit dense, so I definitely was skimming a bit (and probably biased myself by looking at the raw packet captures from the MacOS implementation), but I was interpreting 'Effective Request URI' as: So I think we're good without any of the And I hadn't checked into the If thats something we'd want to account for here, do you have any suggestions on how we'd want that exposed in the API. |
Fixes
Authorization
header generation to include the query parameters (if present).This brings the implementation inline with MacOS, and fixes digest auth with certain picky services.
Tested these changes against the IC Realtime ORB camera I was having issues with in #497, and our application successfully authenticated with this fix.