okay I am through with the stuff
try out whether you get the same signatures and stuff using the values I provided. I even have all the steps included so you can check whether something in the middle is correct or not.
(application)
consumer key: 0123456789abcdef
con secret : fedcba9876543210
(User)
oauth token : 0011223344556677
token secret: 7766554433221100
(request)
Nonce : 8899aabbccddeeff
Time : 1511970896
Oauth Version: 1.0
URL: https://api.twitter.com/1.1/search/tweets.json
encoded: https%3A%2F%2Fapi.twitter.com%2F1.1%2Fsearch%2Ftweets.json
Method: GET
Parameters:
q: hello world
-> encoding: hello%20world
Sig-Method: HMAC-SHA1
HMAC-Key: fedcba9876543210&7766554433221100 (Consumer Secret & token secret)
sorting all of this (and encoding parameters if needed):
oauth_consumer_key=0123456789abcdef
oauth_nonce=8899aabbccddeeff
oauth_signature_method=HMAC-SHA1
oauth_timestamp=1511970896
oauth_token=0011223344556677
oauth_version=1.0
q=hello%20world
parameter String:
oauth_consumer_key=0123456789abcdef&oauth_nonce=8899aabbccddeeff&oauth_signature_method=HMAC-SHA1&oauth_timestamp=1511970896&oauth_token=0011223344556677&oauth_version=1.0&q=hello%20world
encoded again:
oauth_consumer_key%3D0123456789abcdef%26oauth_nonce%3D8899aabbccddeeff%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1511970896%26oauth_token%3D0011223344556677%26oauth_version%3D1.0%26q%3Dhello%2520world
Signature base (Method & URL & Parameters)
GET&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fsearch%2Ftweets.json&oauth_consumer_key%3D0123456789abcdef%26oauth_nonce%3D8899aabbccddeeff%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1511970896%26oauth_token%3D0011223344556677%26oauth_version%3D1.0%26q%3Dhello%2520world
Signature (HEX): 4ea45dffa47d82c4b51de08771b041e93ea5321e
Signature (B64): TqRd/6R9gsS1HeCHcbBB6T6lMh4= (you need to get the HMAC as byte sequence and then base64 encode)
Signature: Encoded: TqRd%2F6R9gsS1HeCHcbBB6T6lMh4%3D
Authorization Header:
OAuth oauth_consumer_key="0123456789abcdef", oauth_nonce="8899aabbccddeeff", oauth_signature="TqRd%2F6R9gsS1HeCHcbBB6T6lMh4%3D", oauth_signature_method="HMAC-SHA1", oauth_timestamp="1511970896", oauth_token="0011223344556677", oauth_version="1.0"