OAuth 2.0 callback URL timing out

Describe the issue/error/question

The OAuth 2.0 callback URL appears to be timing out when adding a credential to our n8n instance, running from a Docker image via AWS ECS in Fargate.

For example, when attempting to connect to Microsoft/Azure via OAuth 2.0, after inputting the correct authorization and token URL’s; the client ID and secret; and the scope, as well as authorizing the callback URL listed in the Azure App Registration, the pop-up window meant to consent to access is blank and hangs until finally indicating that the connection timed out.

When the callback URL is deauthorized in the Azure App Registration, it will go through the consent process before indicating that the callback URL was not authorized.

The same procedure was previously done on n8n Desktop, and was successful.

What is the error message (if any)?

There is initially no error message but just a white screen. After the pop-up window meant to consent to access hangs for about 30 seconds, it is replaced with:

Hmmm… can’t reach this page
n8n.[domain].com took too long to respond

Information on your n8n setup

  • n8n version: 0.220.1
  • Database you’re using: SQLite
  • Running n8n via: Docker, on AWS ECS Cluster
    n8n URL: http://n8n.[domain].com:5678
    WEBHOOK_URL: http://n8n.[domain].com (environment variable)
    Callback URL: https://n8n.[domain].com/rest/oauth2-credential/callback

You should try changing “Execution Mode” to Main.

I had a similar problem but it was with Slack Events API handshake with n8n webhook. Slack was giving error: timeout.

Link to the post I am talking about.

I’ve already investigated this, and it doesn’t appear to be the issue.

I think it has something to do with HTTPS port 443 going nowhere when the redirect response is trying to reach https://n8n.[domain].com

Hi @ThomasLu_EarthDaily, welcome to the community!

I am sorry you’re having trouble. Some services out there will reject insecure redirect URLs. Your example values suggest that n8n is available under http://n8n.[domain].com:5678, but the redirect eventually takes place to https://n8n.[domain].com/rest/oauth2-credential/callback.

So you might need to make n8n available under a valid HTTPS URL here (if your n8n instance sits on the internet it’s a good idea to do that anyway, regardless of OAuth).

1 Like

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