How to get/generate HMAC-SHA1 signature for Twitter in PHP using TwitterOAuth (abraham/twitteroauth)

  hmacsha1, laravel, php, twitter

I am trying to generate my signature with HMAC-SHA1 as suggested by the Twitter documentation.

But I am using the abraham/twitteroauth package to make this "easier" and I leave a screenshot of what it is returning to me.

enter image description here

And the package really works.

Note: What I want to do is RT and FAV to other Tweets from other users. In addition to that, create replies.

Any ideas what can I do or how can I generate this signature?

I tried it with POSTMAN (the one provided by Twitter) and it works there, but it doesn’t work in my code.

The data to generate the signature are:

  • consumer_key
  • consumer_secret
  • access_token
  • token_secret

enter image description here

I am also pointing to the endpoint:

Source: Laravel

Leave a Reply