RESTClient icon indicating copy to clipboard operation
RESTClient copied to clipboard

OAuth 1.0 signature building includes POST body despite Content-Type=application/xml

Open pajaco opened this issue 13 years ago • 2 comments

Given:

Method: POST Path: 'http://localhost/' Consumer key: 'consumerkey' Consumer secret: 'consumersecret' Access token: 'tokenkey' Access token secret: 'tokensecret' Nonce: 'IyuEteyp2WNxdqH' Timestamp: '1358266312' Signature method: 'HMAC-SHA1' Version: '1.0'

As in header:

Authorization: OAuth oauth_version="1.0", oauth_signature_method="HMAC-SHA1", oauth_nonce="IyuEteyp2WNxdqH", oauth_timestamp="1358266312", oauth_consumer_key="consumerkey", oauth_token="tokenkey", oauth_signature="pE%2BWBQ2Hb3oE9%2BLg8jzbR3fPhrQ%3D"

And Content-Type: 'application/xml'

Body variant 1:

<a>
<b />
</a>

Body variant 2:

<a>
</a>

Result (correct)

Signature: pE+WBQ2Hb3oE9+Lg8jzbR3fPhrQ=

However, when I insert an attribute anywhere in the xml:

Body variant 3:

<a>
<b c="d" />
</a>

Result (incorrect)

Signature: 7vvaEhN5fx3KhfGeBCMsZ9Lh1HA=

Shouldn't look into body but apparently it does

Possibly related #19

pajaco avatar Jan 15 '13 16:01 pajaco

Updated with another url (http://localhost/) - signatures changed but the erratic behaviour persists.

Additional info: object logged in the console by restclient.js, line 75 at 'parameters' key has an object which apart from regular OAuth related data now also has another key: partial content of the body up to '=' character. Its value is the remainder of the body after '=' sign:

{
    // snipped key: "headerString"
    "parameters": {
        "<a> <b c": "\"d\" />\n</a>",
        // snipped: oauth_* keys
    }
    // snipped keys: "signature", "signed_url"
}

pajaco avatar Jan 18 '13 11:01 pajaco

I have exactly the same problem!!

chreble avatar Jul 09 '13 16:07 chreble