Skip to main content
New tool CRON Expression Builder — preview next run times before you schedule Apex. Open the builder →
Diagram showing the secure handshake process facilitated by a Salesforce Connected App for API integration.
Integration

Salesforce Connected App: Secure Your API Integrations

Think of a Salesforce Connected App as a digital ID card for your external software. It is your control panel for integration security, and it uses OAuth to run the handshake so nobody has to share a password.

The short answer

A Salesforce Connected App gives you an OAuth framework so external applications can reach Salesforce data securely without sharing user credentials. Configuring one properly means granting the minimum OAuth scopes, picking the right authorization flow, and restricting the user access policy.

Key takeaways Grant only the OAuth scopes the application actually requires instead of giving it full access. Use the JWT Bearer flow with digital certificates for server-to-server integrations to keep them secure and avoid problems with multi-factor authentication. Set Permitted Users to admin-approved pre-authorized users so application access is controlled through profiles and permission sets. Enter a placeholder callback URL, such as a localhost address, to satisfy the OAuth requirement on a server-to-server setup. Review connected app usage in setup to manage IP relaxations, enforce session timeouts, and revoke suspicious connections.

What exactly is a Salesforce Connected App?

If you've ever had to link an external system to your org, you've definitely encountered the Salesforce Connected App. Think of it as a digital ID card for external software. It's the framework that allows an outside application (a mobile app, a middleware tool, a custom web portal) to talk to Salesforce without compromising security. I've seen plenty of developers treat this as the place you go to grab a Client ID. It's your main control panel for integration security.

A Salesforce Connected App uses the OAuth protocol to handle the handshake between systems. Instead of handing over a username and password (which you should never do), the external app presents its credentials to the Connected App. If everything checks out, Salesforce hands back a token that says, "Okay, you're allowed to see this specific data for this amount of time." That's how modern Salesforce API Integration should always be handled.

A realistic UI mockup of the Salesforce Connected App configuration screen showing OAuth settings and API security permissions.

A realistic UI mockup of the Salesforce Connected App configuration screen showing OAuth settings and API security permissions.

How a Salesforce Connected App actually works

When you build one of these, you're defining the rules of engagement. You're telling Salesforce which apps are allowed to knock on the door and what they're allowed to do once they get inside. In my experience, the biggest mistake people make is being too vague with their settings. They'll give an app "Full Access" when it only needs to read a few records. That's a huge security risk you don't want to take.

Here are the parts you'll deal with every single time:

  • The Consumer Key is the public identifier, a username for the app itself.
  • The Consumer Secret is the password for the app. Keep it locked down. If it gets out, anyone can pretend to be your application.
  • The Callback URL is where Salesforce sends the user after they log in. Even on a server-to-server integration, Salesforce usually wants a placeholder here.
  • OAuth scopes are the specific permissions. Do you just need API access? Or do you need to manage the user's identity too? Only check what you actually need.

One thing that trips people up is the Callback URL. Even if your app doesn't technically "redirect" anywhere, Salesforce needs that placeholder to complete the OAuth handshake. I usually just use a localhost address or the app's main URL if I'm stuck.

Choosing the right flow for your Salesforce Connected App

Not every integration is built the same way. The flow you choose depends entirely on what's talking to Salesforce. If you have a web app where a user is sitting at a screen, you'll use the Authorization Code Grant. A backend service with no human involved is a different job.

For those server-to-server jobs, I always recommend the Salesforce JWT flow. It's a bit more work to set up because you need a digital certificate, and it's the safest option you have. It lets the system log in automatically without someone having to type in a password every time a token expires. Most teams get this wrong and try to use the Username-Password flow because it's easier. Don't do that. It's less secure and it'll cause headaches when you eventually turn on Multi-Factor Authentication (MFA).

If you're testing these flows or trying to debug why a connection isn't working, there are some great Salesforce Chrome extensions that can help you inspect headers and see exactly what's happening during the login process. It beats guessing every time.

Securing your Salesforce Connected App

Creating the app is the easy part. Managing it is where the real work happens. Once the app is live, you can go into the "Manage Connected Apps" section to see who is actually using it. You can set IP relaxations, enforce session timeouts, and even revoke access for specific users if something looks fishy. This is probably the most overlooked feature in the whole setup, and it means you can kill a connection instantly when you see unauthorized traffic.

Check your "Permitted Users" policy while you're in there. If it's set to "All users may self-authorize," anyone in your org could potentially link that app to their account. For sensitive integrations, I always change this to "Admin approved users are pre-authorized." That gives you total control via Profiles or Permission Sets. It's just a safer way to live.

Key takeaways

  • A Salesforce Connected App is the secure gateway for any external system trying to access your data.
  • Follow the principle of least privilege and grant only the OAuth scopes the application absolutely needs to function.
  • Use the JWT Bearer flow for backend integrations to avoid the security risks of the Username-Password flow.
  • Keep your Consumer Secret and certificates secure; rotate them regularly to keep the bad guys out.
  • Monitor the "OAuth Connected Apps Usage" page to see exactly who is connecting and when.

A Salesforce Connected App is the foundation of your integration's security, so treat it as more than a checkbox on a project list. Take the extra ten minutes to get your scopes right and pick the correct OAuth flow from the start. Your future self will thank you when you don't have to deal with a security audit or a broken connection because of a password change. Keep it simple, keep it secure, and always test your flows in a sandbox first.

Frequently asked questions

What is a Salesforce Connected App?

A Salesforce Connected App is a security framework that uses the OAuth protocol to connect external software to Salesforce. It lets an external application authenticate and receive limited-access tokens without ever seeing a username or password.

Which OAuth flow should be used for server-to-server integration in Salesforce?

Use the JWT Bearer flow with digital certificates for server-to-server integrations. It handles automated backend authentication and avoids the security risks and MFA conflicts that come with the Username-Password flow.

Why is a callback URL required for a backend Connected App?

Salesforce needs a callback URL to complete the OAuth handshake configuration, even when the integration never performs a browser redirect. You can enter a placeholder, such as a localhost address or the application's main URL, to satisfy it.

How do you restrict user access to a Salesforce Connected App?

Set the Permitted Users policy to "Admin approved users are pre-authorized" in the Connected App settings. That turns off open self-authorization and limits access to assigned Profiles or Permission Sets.

Newsletter

One email every Tuesday

New guides, tool updates, and the release-note changes that break things.

No spam. Unsubscribe in one click.

Comments

Loading comments...

Leave a Comment