Search code examples
laraveltwitterpostmantwitter-oauthlaravel-socialite

Twitter OAuth Access Token Error: Request token missing


I'm trying to run through a proof of concept social sign in flow with Twitter using Postman, following this guide: https://developer.twitter.com/en/docs/twitter-for-websites/log-in-with-twitter/guides/implementing-sign-in-with-twitter

I'm stuck on step 3: Converting the request token to an access token

I'm using Postman's built in Authorization for OAuth 1.0 and have provided values for my Consumer Key, Consumer Secret, Access Token, and Token Secret.

No matter what I try, the response from my POST to https://api.twitter.com/oauth/access_token is a 401:

Request token missing

I'm including my oauth_verifier from step 2 as x-www-form-urlencoded data.

My project is being developed with Laravel and Socialite. I've also tried using the getTokenCredentials method on the League\OAuth1\Client\Server\Server class and get the same Request token missing error.

My end goal is to use the userFromTokenAndSecret method provided by the Twitter Socialite driver to retrieve user profile data.

Has anyone encountered this error before?


Solution

  • I didn't realize the token would also change per step. After using the correct tokens, I'm able to authenticate successfully with Twitter.