N8n Oauth failing

Describe the problem/error/question

When I attempt to setup Oauth2 for twitter or cloud convert, both seem to fail for me.

I observed the URLs are missing the protocol "https’.

For example

cloudconvert.com/oauth/authorize?client_id=REDACTED&redirect_uri=example.com%2Frest%2Foauth2-credential%2Fcallback&response_type=code&state=REDACTED&scope=user.read+task.read+task.write

Manually adding this gets me to the page to approve access on this , but when I click approve, both fail.

cloudconvert.com/oauth/authorize?client_id=REDACTED&redirect_uri=https://example.com%2Frest%2Foauth2-credential%2Fcallback&response_type=code&state=REDACTED&scope=user.read+task.read+task.write

What is the error message (if any)?

TwitterOauth:

CloudConvert Oauth:

Please share your workflow

None yet, only attempting to add credentials

Share the output returned by the last node

No nodes yet, authentication only

Information on your n8n setup

  • **n8n version:**1.114.4
  • **Database (default: SQLite):**postgres:15-alpine
  • n8n EXECUTIONS_PROCESS setting (default: own, main): Unfamiliar, not seen as an ENV
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
    -Operating System: ubuntu 24.04
    -Reverse Proxy: Cosmos Cloud

ENVS:
N8N_HOST - example.com ← my domain
N8N_PROTOCOL - https
N8N_PORT - 443

hello @dalekcoffee

You should configure the WEBHOOK_URL

Configure webhook URLs with reverse proxy | n8n Docs

Thanks for this!

i did have WEBHOOK_URL set to my hostname as well, but I was missing N8N_PROXY_HOPS = 1

I set that and restarted the container, no luck

The only thing remaining is the headers, but I can’t edit headers on this reverse proxy I think, I’ll reference this thread and support doc as a bug/feature request if these headers are needed for oauth flow

I was able to connect with the developer for the reverse proxy, he confirmed these headers are also served by the reverse proxy.

We double checked by installing the following docker container to check the headers being sent
https://hub.docker.com/r/mendhak/http-https-echo

In testing I confirmed the presence of the headers
image

Would there be any other relevant reason for OAUTH failure like this?

Is your OAuth redirect URL in the n8n completely matches the one, defined in the twitter backend?

Hello!

so the URLs are identical except my n8n does not tell me to specify protocol https:// but platforms require it to save the URL so I add it. Besides this, it looks identicall on my end

Diff checker shows what I have in twitter dev on left, and what n8n shows on right,. bottom shows only difference is https:// (my n8n does have a proper SSL cert, I use https:;// when I connect to it)

Then when I click to connect my account in n8n the following window opens up, missing https in the url bar (red highlight)

if i add https manually, it gives me an auth page, but then once I click to authorize my account, it fails again I assume because its trying to reach out without protocol?

Trying to setup dropbox oauth I have similar issues

Seems to be all oauth2, so far: twitter, cloudconvert, dropbox

The URL pasted as a redirect url is the exact same as displayed in my n8n container EXCEPT again, I added https:// on the dropbox website because it will not accept a url without https://

Hi Sorry I am new here. I did a post before but the title is gray. I think my post in NOT online.

Do you know this problem? Thanks.

That means you have a misconfiguration in n8n. Check that the WEBHOOK_URL looks something like:

WEBHOOK_URL=https://example.com/and not just example.com

1 Like

This was my problem thank you so much!!!

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.