Unable to connect Salesforce to n8n with OAuth2 🥲

Hi everyone, first forum question after two years of daily use, but now I’m stumped!

I need to connect n8n to a Salesforce account in production using the Salesforce OAuth2 API.

I followed the tutorial right here:

But when I enter Client ID + Client Secret and click on “Connect my account”, a page opens asking me if I accept, I accept and then nothing.
A blank page that goes round in circles.

I’ve set all the permissions, tried to tick values…

Here are all the values:

For informations I have n8n installed as self hosted on a docker on a server.

If anyone has any ideas on how to do this, I’d love to hear from you!

Information on your n8n setup

  • n8n version: 0.234.0
  • Database (default: SQLite): SQLite
  • n8n EXECUTIONS_PROCESS setting (default: own, main): own
  • Running n8n via (Docker, npm, n8n cloud, desktop app): Docker
  • Operating system: Ubuntu

Hello!

Does anyone have any idea how to fix this problem? :cry:

I’m interested in any ideas!

Thanks!

Hey @teltel,

Is there any error at all on the salesforce side? Can you also try connecting with your browser using the private browsing option to rule out anything odd.

Hello @Jon,

Sorry for the late reply, I didn’t have any reason to :/.

No error from SalesForce, I think it’s the URL callback that’s not working.

I’ve tried to do it in private browsing as well as changing browser but nothing at all :confused:

Hey @teltel,

It could be but sadly I can’t see what n8n is getting back, The blank page in your screenshot looks like Salesforce is having a problem so it could be worth reaching out to their support team.

Wow! I thought I was the only one facing this issue and concluded I was doing something wrong even though I followed it to the T. Glad I’m not the only one - was losing my mind trying to make it work.

@teltel - were you able to find a solution for this?

I have the same issue, with JWT and OAuth2.
I add everything according to the instructions and always get an error “ERROR: Bad request - please check your parameters
invalid_grant”

Hey @rpa and @tre,

If you open the browser dev console when trying to connect does it show any errors?

Hi, @Jon .
There is only n8n logo drawed, without errors.

p.s. described error detailed in prev. reply.

Hey @rpa,

invalid_grant could be that a scope / permission is missing, What did you allow in Salesforce?

I granted full access. As stated in the instructions

For me, it stays blank for a while and if I refresh it, it shows an OAuth Error message itself.

If I don’t refresh it, it ends up giving a 504 gateway timeout (I’m reciting this from memory, may not be the exact code)

I’m not sure if its causing the issue but try unchecking enable client credentials flow on your Salesforce Oauth Connector. I don’t think that i have that checked in my setup.

Helo, @teltel.
Try to uncheck “Require Secret for Refresh Token Flow”

Unchecked the both of them - still the same error message pops up.

I’ll give it 12 hours and test it again.

Wow, a lot of answers but no I haven’t found any solutions, it wasn’t a priority but it’s becoming one.

@tre Do you have the same problem? Blank page when you try to connect?

What is the config of your n8n ? Self hosted ? Which provider? Maybe I have the same ?

@tre Have you tried the second authentication method?
Or anyone else?

I’ve really tried unchecking the boxes too but nothing works :confused:

I have just set up a new Salesforce Developer account and I will take a look at this later today to see if I can work out what is going on.

2 Likes

I managed to get it to work, but on a different instance.

On another n8n instance (which is installed on AWS) I can connect super easily, I don’t get a blank page when connecting.

But with an instance on Hetzner I have this problem. Maybe a different installation? SSL certificate? Wrong configuration?

In your case n8n is on which instance? A particular config @Jon and @tre?

I just gave my newly created salesforce created app a go and it just works, My assumption here is this is likely to be a config issue or maybe a browser plugin / ad blocker preventing the authentication attempt.

@Jon

I’m using this managed service called elest.io to host n8n. So, I’m assuming it is because of a different installation, but I’m not sure what I can do to make it work though.