Salesforce Sandbox OAuth2 connection failed

I am trying to connect to salesforce sandbox via OAuth Connection

I’m trying to connect my Salesforce Sandbox to n8n Cloud using the built-in Salesforce OAuth2 credential.

  • n8n version: 1.110.1 (Cloud)

  • Auth type: OAuth2

  • Database: default

  • Execution process: default

What I tried:

  1. Created a Connected App in Salesforce with OAuth enabled.

  2. Added the n8n redirect URI in the Connected App.

  3. In n8n, set up a new Salesforce credential → selected Environment Type = Sandbox.

  4. When I click Connect my account, it always redirects me to login.salesforce.com (production login), not test.salesforce.com or my sandbox domain.

Since the redirect always goes to login.salesforce.com, my sandbox user credentials are rejected with incorrect email/password, they only work on the sandbox domain.

What am I missing ? Need urgent help with this.

Hi @Priyanshi_Gangwar

We’re already looking into this issue, and there’s a PR in progress to address it fix(Salesforce Node): Login prompt in Oauth2 credentials for authUrl by michael-radency · Pull Request #19450 · n8n-io/n8n · GitHub

Thanks. Any idea how much time it will take?

it’s currently in review so hopefully will be included in the beta release on Monday next week

Hi @Shireen, any update on this topic ? I face the exact same issue :confused: Thanks !

The fix was released in 1.113 what version of n8n are you on?

I’m on 1.117.0 and still can’t authenticate on my sandbox domain

I found that selecting “Use Custom Domain” and entering the sandbox name was a successful workaround when prompted with the login.salesforce.com authentication screen

Hi, i tried with custom domain : test.salesforce.com or https://test.salesforce.com but i still have production login.salesforce.com.
Could you tell me witch value you’re used