Overview
- Objective: This guide provides a modern roadmap for a secure Salesforce to Salesforce integration using Salesforce Named Credentials to replace hardcoded authentication.
- Technical Focus: The content highlights the 2026 transition to External Credentials Salesforce for enhanced security within professional Salesforce API integration workflows.
- Best Practices: It outlines essential Salesforce integration best practices, focusing on the proper configuration of a Salesforce connected app and Salesforce external services.
- Strategic Value: The blog serves as a resource for Salesforce integration consulting, demonstrating how modern Salesforce integration patterns reduce technical debt and maintenance.
In the high-stakes world of enterprise data, silos are more than just an inconvenience—they are a bottleneck. For those of us managing multiple environments, the dream is a seamless flow of data. While there are plenty of Salesforce integration patterns to choose from, one specific method stands out for its elegance and security: Salesforce Named Credentials.
When you’re tasked with a Salesforce to Salesforce integration, the old-school way of doing things—manually handling OAuth tokens and hardcoding endpoints into your Apex—is a recipe for a maintenance nightmare. This is exactly where Named Credentials in Salesforce come in handy. By pulling the authentication logic out of the code and moving it into the setup menu, you create an architecture that is actually sustainable.
Why Use Named Credentials in Salesforce?
So, why bother? Why is this the gold standard for Salesforce integration best practices? In the past, every time you wanted to make a callout, you had to jump through the hoops of Remote Site Settings and manually manage authentication headers. It was clunky and prone to errors.
By pivoting to Salesforce Named Credentials, the platform essentially takes over the heavy lifting. It manages the handshakes for you. Additionally, with the introduction of External Credentials Salesforce, admins now have a tighter grip on security. You can control exactly who gets to trigger a callout using permission sets, which is a massive upgrade for security-conscious teams.
The Building Blocks of a Modern Salesforce API Integration
To get a Salesforce API integration running without a hitch, you need to understand the four pillars of the setup:
- Salesforce Connected App: Think of this as the “ID card” for your target org. It tells the system who is allowed to knock on the door.
- External Credentials Salesforce: This is the modern engine for authentication. It works alongside your Named Credentials to define how you prove your identity.
- Salesforce Named Credentials: The actual endpoint definition that your Apex code or Salesforce external services will call.
- Auth Provider: This acts as the bridge, telling Salesforce how to talk to the identity layer of the other environment.
Step-by-Step: Setting Up Your Salesforce to Salesforce Integration
1. The Gateway: Salesforce Connected App
Your first move is in the target org—the one you want to pull data from. Go to Setup | App Manager and roll out a new Salesforce connected app.
- Enable OAuth: This is non-negotiable.
- Callback URL: Put a placeholder in for now. You’ll swap it out once the Auth Provider gives you the real one.
- The Scopes: At a minimum, you’ll need Full Access (full) and perform requests at any time (refresh_token).
Once you hit save, grab the Consumer Key and Consumer Secret. You’ll need these in a moment for your Salesforce API integration setup.
2. The Bridge: Auth Provider
Now, flip over to your source org. Under Auth. Providers, pick Salesforce. This is the secret sauce for a smooth Salesforce to Salesforce integration.
- Plug in that Consumer Key and Secret you just grabbed.
- Set the Default Scope to refresh_token full.
- Pro Tip: Once saved, copy the Callback URL generated here and paste it back into your Connected App in the target org.
3. The Security Layer: External Credentials Salesforce
This is where many older guides fall short. Modern Salesforce integration best practices dictate using External Credentials Salesforce. Instead of a “one-size-fits-all” login, you create a Principal. This allows you to link specific permission sets to the credential, ensuring that only the right people (or processes) are making those calls.
4. The Final Touch
Now, let’s wrap it up. Go to Named Credentials in Salesforce and hit “New.”
- Label: Give it a clear name like Target_Org_Production.
- URL: Use the My Domain URL of the target instance.
- External Credential: Point it to the record you just made in Step 3.
Because you’re using Named Credentials, you can officially say goodbye to Remote Site Settings. The platform trusts the URL automatically, which is a hallmark of clean Salesforce integration patterns.
Leveraging Salesforce External Services
If you’re a fan of low-code solutions, Salesforce external services are a dream. They can “consume” your Salesforce Named Credentials and let you build integrations using Flow. No code, no stress. Any high-end Salesforce integration consulting team will tell you: if you can do it declaratively, you probably should. It makes the Salesforce to Salesforce integration much easier for the next admin to manage.
The Apex Side of Things
When you finally do need to write code, the results are incredibly clean. Since Named Credentials in Salesforce handle the “dirty work” of tokens, your code is just pure logic:
Apex
HttpRequest req = new HttpRequest();
// No hardcoded URLs or tokens here!
req.setEndpoint(‘callout:Target_Org_Production/services/data/v60.0/sobjects/Account’);
req.setMethod(‘GET’);
Http http = new Http();
HTTPResponse res = http.send(req);
This tiny snippet is the end result of a professional Salesforce API integration. It’s secure, it’s readable, and it won’t break the moment a password changes.
Essential Salesforce Integration Best Practices
Before you push to production, keep these Salesforce integration best practices in mind:
- Prioritize External Credentials Salesforce: It’s safer and more flexible than the legacy named credential models.
- Version Control: Keep an eye on your API versions in your Salesforce API integration to avoid unexpected breakages during Salesforce releases.
- Monitor Your Limits: Even the best Salesforce integration patterns are subject to API governor limits.
- Expert Oversight: If you’re dealing with high-volume data, a quick sync with a Salesforce integration consulting partner can save you from a performance bottleneck later.
The Future of Salesforce Integration Patterns
The platform is moving toward a future where “Named Credentials in Salesforce” and Salesforce external services do the heavy lifting, allowing developers to focus on user experience rather than protocol plumbing.
Conclusion
A successful Salesforce to Salesforce integration shouldn’t be a house of cards. By leaning on Salesforce Named Credentials and the robust security of External Credentials Salesforce, you’re building a bridge that is as secure as it is efficient.
If you find yourself stuck on complex Salesforce integration patterns, don’t hesitate to consult with a Salesforce integration consulting expert. They can ensure your Salesforce connected app is optimized and that you’re following every Salesforce integration best practice available today.
At the end of the day, using Named Credentials isn’t just a technical choice—it’s a commitment to a cleaner, more secure Salesforce environment.


