Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

oauth_body_hash parameter doesn't appear to be part of the spec! #230

Answered by pboling
chuckremes asked this question in Q&A
Discussion options

I'm using this library to connect to the ETrade API which uses OAuth 1.0. All of the GET requests work just fine. However, anything with a body (e.g. POST or PUT) fails because the signature includes oauth_body_hash as part of the base string computation. (I've confirmed this by monkey patching this library and removing that parameter.)

I see that oauth_body_hash was added in an old commit 3edeaf4 . It references some "OAuth Body Hash Draft 4" document. I can't see that this draft was ever ratified and/or accepted as part of the OAuth 1.0 (or 1.0a) protocol. Here's a link to the oauth 1.0a protocol and here's a link to the oauth 1.0 protocol.

None of them reference any header value named oauth_body_hash at all.

The inclusion of this value breaks the oauth comms with ETrade (and presumably others). I am going to make a PR to allow for disabling this header but I wanted to start a discussion here to make sure it would be accepted.

What am I missing here?

EDIT: used this tool which is an online oauth1 sandbox that computes signatures from various inputs. For POST, it does not ask for the post body as an input. It also doesn't produce any oauth_body_hash field. Circumstantial evidence that this body hash is not part of the spec.

You must be logged in to vote

The OAuth request body hash extention is an oauth 1.0a extension by Google. Many services use it, e.g. Mastercard, and, of course, many do not. It should have always been an option in this library. Thanks for fixing it @chuckremes !

Replies: 2 comments

Comment options

#232

PR to disable.

You must be logged in to vote
0 replies
Comment options

The OAuth request body hash extention is an oauth 1.0a extension by Google. Many services use it, e.g. Mastercard, and, of course, many do not. It should have always been an option in this library. Thanks for fixing it @chuckremes !

You must be logged in to vote
0 replies
Answer selected by chuckremes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /