Reputation: 1891
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?
Upvotes: 7
Views: 9502
Reputation: 792
For users like me and @seinecle who were facing the issue despite having the right token, the Twitter's Postman collection has an issue. Simply change step-3's Authorization type to "No Auth" and send the request again.
EDIT: Link to postman collection - https://www.postman.com/twitter/workspace/twitter-s-public-workspace/collection/241622-2f1af03a-a3fe-4b8a-9b1a-bd0b84789e50
Upvotes: 10
Reputation: 1891
I didn't realize the token would also change per step. After using the correct tokens, I'm able to authenticate successfully with Twitter.
Upvotes: 4