2
votes

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?

1
are you sure you are sending in the correct token? for https://api.twitter.com/oauth/access_token, you have to use the token obtained from step 2. developer.twitter.com/en/docs/basics/authentication/overview/… https://yourWhitelistedCallbackUrl.com?oauth_token=NPcudxy0yU5T3tBzho7iCotZ3cnetKwcTIRlX0iwRl0&oauth_verifier=uw7NjWHT6OJ1MpJOXsHfNxoAhPKpgI8BlYDhxEjIBYjaanhio
Ah yes, I didn't realize the token would change per step. Thanks!brice
I have exactly the same issue but... in the example linked above, the request token remains the same at all steps? (it is oauth_token=NPcudxy0yU5T3tBzho7iCotZ3cnetKwcTIRlX0iwRl0 in step 2 and 3). Completely lost...seinecle

1 Answers

2
votes

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