Error when authorising Microsoft Teams credentials

Trying to hook up the Microsoft Teams node as part of an error node

What is the error message (if any)?

After following the guide and filling in all the details, after entering my Microsoft credentials to verify the connection, I get the error Cannot GET /rest/oauth2-credential/callback . This was working a while ago but credentials expired and when attempting to renew them, this is the error I am receiving. It is attempting to open that path on the webhooks url that has been configured with the WEBHOOK_URL env variable

Information on your n8n setup

  • v0.160.0

  • DB: Postgres

  • n8n running in docker, on a kubernetes cluster. We have 1 main container, 1 webhook container, and 2 worker containers

Hi @IbnJubayr, I am sorry to hear you’re having trouble here. I just tried authorizing MS Teams on [email protected] without running into the problem you have described:

Is the path used for the OAuth redirect possibly not reaching your main n8n container on your end?

Hey @MutedJam , thanks for the response.

Is it meant to go to the main container? Because it certainly isn’t going there - the OAuth Redirect URL is appearing with the webhook url that has been configured in the WEBHOOK_URL environment variable, see below. This field is also read only

We access the n8n app via workflows.[mydomain].io

Hey @IbnJubayr,

My understanding is it needs to go to the main instance not the webhook workers, Would need to give it a test / check with @krynble to confirm though.

2 Likes

Hi @Jon @krynble - any update on this?

Hey @IbnJubayr,

I had another look at the docs and noticed that it says to send anything for /webhook/ to the webhook workers and anything else needs to go to the main instance to handle.

Are you able to configure your load balancer / proxy to route the /rest/ requests to the main instance?

Hey @Jon

Thanks - I will check if we have a load balancer configured, but I suspect we don’t as we have two different domains for the main process and the webhooks e.g. workflows.mydomain.io and webhooks.mydomain.io and the docs suggest a load balancer for when the domains are the same

What @Jon mentioned is correct - the OAuth process should be redirected to the main n8n instance.

The webhook processes are responsible for HTTP calls related to workflow execution only. The authentication part is handled by the main process.

The scenario that you’re using, with 2 different subdomains for main / webhook processes is currently not supported by us. Our recommendation is to actually use the same domain but switch traffict:

/webhook/ → should be redirected to the webhook processes
* → should be redirected to the main n8n process

1 Like

Hey @krynble - thanks for confirming. Any plans to support having 2 different subdomains in the future?

I managed to work around the current issue by manually modifying the URL and navigating to it

Hey @IbnJubayr there are plans to it; a recent release created the new N8N_EDITOR_BASE_URL environment variable but it still not functional. This should be supported in the near future.

1 Like

Thanks for the update - just fyi we’ve been using it with two different domains for over 6 months and its been working fine :sweat_smile:

1 Like

Yes, it should work fine, the problem is that for this to work you have your n8n’s main instance running under workflows.yourdomain.io so if n8n needs to register a webhook on another service (let’s say Slack), it will register the workflows.yourdomain.io/webhook url instead of webhooks.yourdomain.io/webhook causing split traffic and unintended behavior by sending some webhook calls directly to the workflows instance.

Other than this, it should all work fine :slight_smile:

Ah! That’s good to know - we’ve only been using custom nodes at this point so haven’t run into this problem