I'm attempting to get an access token and secret from a site using OAuth. The exchange of request token and request secret goes fine, but when it comes time to get the access tokens I get the error "Invalid signature. Expected signature base string."
Has anyone seen this error before or know what might be wrong? Here is the data I am getting back (after urldecode
-ing it):
Invalid signature. Expected signature base string: POST
https://www.readability.com/api/rest/v1/oauth/access_token
oauth_consumer_key=my_consumer_key
oauth_nonce=d9aff6a0011a633253c5ff9613c6833d79d52cbe
oauth_signature_method=HMAC-SHA1
oauth_timestamp=1311186899
oauth_token=C8GF7D6ytPzQKdZVpy
oauth_verifier=ncUV4tJSrS
oauth_version=1.0
signature=7jUuk6fsEL8XNYxVWcsfGXEreK0%3D
As @genesis described, it is pretty painful to get the signature key right, but there are documentation for it, which can be seen on this link http://oauth.net/core/1.0/#encoding_parameters.
The rule of thumbs is when you work with HMAC-SHA1,
Source: http://nouncer.com/oauth/authentication.html
you can take a look here, it was asked about a week ago. Response:
Getting the OAuth signature stuff exactly right is always a huge pain. You should try hard to make sure the base string your library generates is just like the one the server is expecting. Once that's true, the only way you can screw up is to hmac with the wrong key(s).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With