Describe the issue/error/question
Hello,
First of all, to present you the context:
- I need to use the API v2 of twitter
- But I need some very recent features
- For this I need an OAuth2 authentication (so neither OAuth2 Bearer nor OAuth1)
So I can’t use the twitter node.
Therefore I tried to use the HTTP Request node with an OAuth2 credential.
I have entered my OAuth Redirect URL in my twitter App.
I have correctly entered my Access Token URL (https://api.twitter.com/2/oauth2/token), as well as my Client ID and Client Secret.
Concerning the Authorization URL, I made a URL like : https://twitter.com/i/oauth2/authorize?response_type=code&client_id=CLIENT_ID&redirect_uri=https://EXEMPLE/rest/oauth2-credential/callback&scope=tweet.read%20users.read%20offline.access&state=state&code_challenge=challenge&code_challenge_method=plain
I can then connect to click on “Connect my account”, I validate the connection with my account.
What is the error message (if any)?
And then the following error appears:
{"code":0,"message":"Invalid state format returned","hint":"","stack":"ResponseError: Invalid state format returned\n
at /usr/local/lib/node_modules/n8n/dist/src/Server.js:1065:43\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:137:13)\n at Route.dispatch (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/route.js:112:3)\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at /usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:281:22\n at Function.process_params (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:341:12)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:275:10)\n at /usr/local/lib/node_modules/n8n/dist/src/Server.js:318:13\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:323:13)\n at /usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:284:7\n at Function.process_params (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:341:12)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:275:10)\n at /usr/local/lib/node_modules/n8n/dist/src/Server.js:310:17\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)\n at trim_prefix (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:323:13)\n at /usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:284:7\n at Function.process_params (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:341:12)\n at next (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/index.js:275:10)\n at urlencodedParser (/usr/local/lib/node_modules/n8n/node_modules/body-parser/lib/types/urlencoded.js:91:7)\n at Layer.handle [as handle_request] (/usr/local/lib/node_modules/n8n/node_modules/express/lib/router/layer.js:95:5)"}
Despite the fact that I have examined the documentation (OAuth 2.0 Authorization Code Flow with PKCE | Docs | Twitter Developer Platform), I cannot understand where the error is located.
So I thank you in advance for your help
And don’t hesitate to ask me if you need more information.
Alexandre “Dadourlou” LECOEUR
Information on your n8n setup
- n8n version: 0.162.0
- Database you’re using (default: SQLite): Default
- Running n8n with the execution process [own(default), main]: Default
- Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker