nango
nango copied to clipboard
Twitter requests return "Could not authenticate you"
Any help would be very appreciated :)
Problem
When I query the twitter api through the pizzly proxy, I get this error :
Object
errors:Array[1]
0:Object
code:32
message:"Could not authenticate you."
Steps to reproduce
- deploy Pizzly on platform.sh or run it locally
- Create a Twitter developer account and a twitter app with 3-legged OAuth enabled and callback urls configured
- Setup a twitter configuration in pizzly
- In Authentications tab, connect to twitter
- Use the generated authId to query "statuses/home_timeline.json" or "statuses/user_timeline.json?screen_name=twitterapi&count=2"
Not sure why this is happening. I'm seeing it too when testing a new account, but it certainly worked fine in the past. Perhaps something with changes to their auth or config with the new v2 API.
I find out the solution, pizzly query parameters need to be removed before calling the twitter API :
https://github.com/Bearer/Pizzly/blob/master/src/lib/proxy/index.ts#L160 https://github.com/Bearer/Pizzly/blob/master/src/lib/proxy/index.ts#L67
@maximeNaulleau did you resolve the issue, even when I do my own curl call, the authentication tokens provided by twitter do not work
@TanAidan , I replaced the oauth library used for oauth1 with this one : https://www.npmjs.com/package/oauth-1.0a
You can easily read the source code and get any information you need for your curl call. Be sure that pizzly_*
params are not included during the signature generation.