Hi everyone! I can’t connect my X account via OAuth2 in n8n and I’m completely out of ideas.
Environment:
n8n: Cloud (free trial version)
Browsers tried: Chrome, Safari and Edge — same result in all of them
I’m logged into my X account in the browsers
What happens:
I create a Twitter (OAuth2) credential and click “Connect my account”. The X authorization window opens (link looks like: twitter.com/i/oauth2/authorize?code_challenge=), and then one of two things happens:
Either the consent window renders completely BLANK — instead of the Authorize / Cancel buttons there’s just an empty black box, so there’s nothing to click;
Or it just throws me back to the X login page again (a loop), even though I’m already logged into X in the same browser.
There’s nothing to click, so I can’t get past this step.
What I’ve already tried (none of it helped):
Recreated the credential several times and regenerated the Client ID / Client Secret (keys) in the X Developer Portal.
Double checked the OAuth Redirect URL.
Created brand new apps in the X Developer Portal
Changed browser settings: disabled adblock, allowed cookies and third-party cookies
Tried incognito mode
Tried three different browsers (Chrome, Safari, Edge)
What could be causing this blank authorization window, and how do I fix it? Thanks in advance!
Make sure the Type of App is set to Web App, Automated App or Bot.
Next,
Click Connect my account inside n8n to open the blank authorization popup window.
Copy the entire, massive URL out of that popup window’s address bar.
Paste it into a text editor (like Notepad or Notes).
Look at the very beginning of the URL string. Change the domain from twitter.com to x.com (e.g. change https://twitter.com/i/oauth2/authorize?… to https://x.com/i/oauth2/authorize?…) Keep every single other character exactly the same.Copy your newly modified link, paste it into a normal browser tab where you are actively logged into X, and press Enter.
Authorize the app from there. It will redirect back to n8n Cloud and successfully pass the authorization token.
Glad to hear that worked for you! If you don’t mind, could you please mark my reply or your reply as the solution? It helps other people in the community find the answer quickly if they run into the same issue. Thanks!
You’ve already done all the “usual” OAuth2 debugging (new app, new keys, different browsers, cookies, incognito, redirect URL, etc.), so at this point I’d treat this less like a misconfigured app and more like a front‑end bug in X’s consent screen.
Right now the authorize URL that n8n opens still uses twitter.com/i/oauth2/authorize?``..., but your session + app live under x.com, which seems to be what’s causing the blank consent box or the login loop.
A workaround that has worked for other tools in the same situation is:
Click Connect my account in n8n so the blank X popup opens.
Copy the full long URL from the address bar of that popup.
In a text editor, change only the domain from https://twitter.com/... to https://x.com/... and keep everything else exactly the same.
Paste this modified URL into a normal browser tab where you’re already logged into X, hit Enter, and complete the Authorize step there – X should then redirect back to n8n Cloud with the token.
If that flow still results in a blank page even on x.com, the next step would be to open a ticket with n8n Cloud support so they can check whether X is returning something unusual for your app/region that the credential UI isn’t handling correctly.
A blank X consent window (rather than an error) usually means the authorize request reached X but something in the app config makes X render nothing instead of the consent screen. A few specific things to check, since you have already ruled out the browser by trying three.
In your X developer app: confirm the app has OAuth 2.0 enabled (not only 1.0a), the Type is set to a confidential client (Web App, since you are using Client ID and Secret), and the callback URL registered there is the exact n8n OAuth2 callback. A callback mismatch on X sometimes shows as a blank window rather than a clear error, which is what makes this one confusing. Also confirm the required scopes are set on the credential, an empty or invalid scope set can produce a blank consent.
One more that bites on the free trial specifically: make sure the X app is attached to a Project in the X developer portal, standalone apps without a Project cannot complete OAuth 2.0 and often fail silently like this. If you paste (with secrets removed) your callback URL and which OAuth version is toggled, it is usually quick to spot. Does the blank window have any URL with an error parameter in it when it opens?