We’re currently encountering a persistent “Not Found” error when attempting to authorize OAuth-based credentials for services such as X (Twitter), LinkedIn, Google, and Facebook on our self-hosted n8n instance.
Upon further inspection, we noticed that the n8n account URL we’re using is: https://n8n-[xxxx].onrender.com/
However, the OAuth Redirect URL configured in the developer apps is pointing to a different instance: https://n8n-[yyyy].onrender.com/rest/oauth2-credential/callback
This mismatch appears to be the likely cause of the issue, as the callback URL must exactly match the instance where the authorization is initiated. We’ve verified client IDs, secrets, scopes, and even recreated the apps and credentials multiple times without success.
If anyone has encountered this before or has recommendations on resolving this redirect mismatch on Render-hosted n8n deployments, your insights would be greatly appreciated.
The oauth2 provider doesn’t normally send the redirect URI from its config. It sends back the URI supplied by the client, on each authorization sequence, embedded in the confirmation screen content (with permissions checkboxes, etc.).
Some oauth2 app configurations, like Google, allow you to Authorize more than one redirect URI. See Clients config page
The instance of n8n, where you are creating the credential, should display the redirect URI it will send to the oauth2 provider during the authorization sequence. If this is displaying the wrong redirect URL…
Update the environment variable value for WEBHOOK_URL
Restart n8n
Fully reload the n8n editor/app in your browser
Try again
If you can only authorize one redirect URL in the app configuration for an oauth2 provider, you may need to create multiple apps (different client id/secret for each distinct redirect URI).