Absolute Minimum Code to Get a Valid Oauth_Signature Populated in Java or Groovy

Twitter Authorization

oauth_timestamp isn't randomly generated, it is the current time. e.g. your example above is (verify with http://www.onlineconversion.com/unix_time.htm)

Sat, 02 Jul 2016 08:38:58 GMT

oauth_nonce is random as described in the help page below, e.g. "base64 encoding 32 bytes of random data".

oauth_signature is calculated based on your request parameters, sometimes post body, the client token/secret etc.

https://dev.twitter.com/oauth/overview/authorizing-requests
https://dev.twitter.com/oauth/overview/creating-signatures

This is some example code for signing requests
https://github.com/yschimke/okurl/blob/release/1.4/src/main/java/com/baulsupp/oksocial/services/twitter/Signature.java

LinkedIn OAuth: signature_invalid response when requesting a POST HTTP request (for request token)

I've figured it out. The problem was with normalizing the Base String URI. The path of the URI must not be in lowercase (in which mine did). I've fixed the issue. The issue was in method found in net.oauth.util.OAuth1Util.normalizeUrl() method.



Related Topics



Leave a reply



Submit