A legacy system with no browser and no user at the keyboard connects to Salesforce today through an external client app with either the OAuth client credentials flow or the JWT bearer flow, then calls REST, SOAP or Bulk API 2.0 with the access token. The username-password flow most older integrations were built on retires on February 20, 2027, and new connected apps can no longer be created. For traffic going the other way, Salesforce pushes changes out with outbound messages, platform events or Apex callouts, and the right one depends on what the old system can receive.
For a SaaS company, this is rarely one integration. It is your own backend jobs plus every enterprise customer whose ERP, mainframe or on-premise database has to reach their Salesforce org through your product. Each of those connections has to keep working after the old flows switch off, inside each customer's own API allocation. Appnigma's done-for-you integrations service is built for this ("Build your product. We'll build the integrations."). A named integration engineer connects to each customer's system "with the right APIs, authentication, and platform-specific code" and keeps those integrations working "as APIs and requirements change."
Updated October 2026. Checked against the Salesforce Integration Patterns and Practices guide, the SOAP and REST API guides, Salesforce Help and the Salesforce security roadmap. The earlier version recommended the username-password flow and a new connected app, and suggested refresh tokens for long-running jobs. This update covers the two server-to-server flows that replace it, the retirement dates, outbound messaging limits and per-org API arithmetic.
Which auth flow a system with no user login should use
Pick the flow by what the old system can do. The client credentials flow needs only a consumer key and secret over HTTPS, while the JWT bearer flow needs the system to sign a token with a private key. Both run on an external client app (ECA), the registration that lets an outside system use Salesforce OAuth, and neither one returns a refresh token. Our guide to creating an external client app covers the setup screens.
| Legacy system can... | Use | What the Salesforce admin sets up | Source |
|---|---|---|---|
| Send an HTTPS POST and keep a secret | Client credentials flow | A run-as user with the API Only permission, calls to the org's My Domain URL | Client Credentials Flow |
| Sign an RS256 JWT with a private key | JWT bearer flow | Upload your certificate, pre-approve the user named in the token | JWT Bearer Flow |
| Only send a username and password | Neither. Plan a change before February 20, 2027 | Not available on ECAs | Security roadmap |
| Open a browser once for an admin to approve | Web server flow with PKCE, then refresh tokens | A user authorizes once per org | Web Server Flow |
Client credentials is the usual pick for an old system, because it asks for nothing beyond what the system already does with a password. Salesforce "returns an access token on behalf of the integration user you assigned," per the client credentials page, and that run-as user "must have the API Only permission," per the ExtlClntAppOauthConfigurablePolicies reference. Every record the integration writes shows that user as the author, so name it after the system (for example, "ERP Integration") rather than after a person who might leave.
JWT bearer suits systems that already sign requests, such as a Java or .NET service with a keystore. It "uses a certificate to sign the JWT request and doesn't require explicit user interaction," but "this flow does require prior approval of the client app," per the JWT bearer page. The secret never crosses the network, which is why security teams at larger customers often ask for it.
Is the username-password flow being retired?
Yes, on February 20, 2027, and it is one of two changes that end the setup most legacy integrations still use. First, "Creating connected apps is restricted as of Spring '26," per the REST API Developer Guide. Existing connected apps keep working for now, and Salesforce's security roadmap article lists connected app end of support for Summer '27. Second, the same article lists the username-password, user-agent and hybrid flows for retirement on that February date.
The username-password flow will not move to ECAs either. Salesforce states that "the OAuth username-password flow won't be made available for external client apps," per its comparison of connected app and ECA features. Moving a legacy job to an ECA therefore always means changing how it authenticates, not only where its consumer key lives. Our comparison of connected apps and external client apps covers the migration itself.
SOAP-only systems have a second deadline. "Salesforce is retiring SOAP API login() in the Summer '27 release," and "It is disabled by default for orgs created in Winter '26 and later," per the login() reference. A system that calls login() with a password and security token needs the same switch to OAuth, even if it never touches REST. Our post on OAuth with the SOAP API walks through that change.
The token request and the first API call
A client credentials request is a single form POST to the customer's My Domain host. "Requests to https://login.salesforce.com and https://test.salesforce.com aren't supported. Use your My Domain URL instead," per the client credentials page.
POST /services/oauth2/token HTTP/1.1
Host: customername.my.salesforce.com
Content-Type: application/x-www-form-urlencoded
grant_type=client_credentials&client_id=<consumer key>&client_secret=<consumer secret>The response carries access_token and instance_url. Send every later call to that instance URL. REST takes the token as Authorization: Bearer <access_token>, and for SOAP "use the SessionHeader SOAP authorization header. The access token is placed in the header," per the core data types page. An XML-only system can keep its SOAP envelopes and change only how it gets the session.
GET /services/data/v68.0/query?q=SELECT+Id,Name+FROM+Account+WHERE+LastModifiedDate+>+YESTERDAY HTTP/1.1
Host: customername.my.salesforce.com
Authorization: Bearer <access_token>Version 68.0 is Winter '27, and Salesforce lists "Versions 41.0 through 68.0" as supported in its API End-of-Life Policy. Check what an org supports with the List Available REST API Versions resource and pin one, rather than hardcoding the version an old tutorial used.
Because neither server flow returns a refresh token, the old system has to handle expiry itself. Sessions follow the org's timeout, and "The default is two hours," per the login() reference. The simplest pattern is to cache the token, and when a call fails with INVALID_SESSION_ID, request a new token once and retry. Many legacy jobs store a session in a config file at deploy time, and that is the code that breaks first.
Which API to call in each direction
For calls into Salesforce, the Remote Call-In pattern gives the volume rule. "Any data operation that includes more than 2,000 records is a good candidate for Bulk API 2.0," while smaller jobs "should involve 'bulkified' synchronous calls in REST (for example, Composite) or SOAP." The same guide notes that "Remote calls to Salesforce are always synchronous request-reply."
For data leaving Salesforce, the choice depends on what the legacy side can receive.
| Legacy side can receive | Use | What to plan for | Source |
|---|---|---|---|
| A SOAP message on an HTTPS endpoint | Outbound messaging | Messages are dropped after 24 hours and can arrive twice or out of order | Understanding Notifications |
| A gRPC stream over HTTP/2 | Platform events or Change Data Capture through Pub/Sub API | Needs a gRPC client and Avro decoding, usually in a small adapter service | Pub/Sub API subscribe |
| A REST call to its own API | Apex callout through a named credential | The legacy endpoint must be reachable from Salesforce | Request and Reply |
| Nothing, the data should stay where it is | Salesforce Connect external objects | Reads hit the legacy system live, so its uptime becomes Salesforce's | Data Virtualization |
Outbound messaging is the closest fit for older SOAP stacks, and its delivery rules decide how you build the listener. Undelivered messages stay queued "until they're 24 hours old," and retry intervals grow "up to a maximum of two hours between retries," per Understanding Notifications. The same page warns that a message "can sometimes be delivered more than one time," so the listener should check notification IDs before it writes anything. A weekend outage on the legacy side loses messages, which means you also need a nightly catch-up query.
Pub/Sub API is the modern route. It is "Based on gRPC and HTTP/2" and delivers "binary event messages in the Apache Avro format," per the Pub/Sub API subscribe guide. Events are "stored for 72 hours," per Pub/Sub API and the Expanded Event Bus, so a subscriber that is down longer than that has to resync from a query. Few mainframe or older ERP stacks speak gRPC, so most teams run a small subscriber service that turns events into whatever the old system accepts, such as files, queue messages or SOAP calls. Our comparison of platform events and Change Data Capture covers which event type to subscribe to.
What changes when a SaaS product does this for many customer orgs
A SaaS product that connects legacy systems to many customers' Salesforce orgs repeats the setup in every org, because each org has its own run-as user, My Domain URL and API allocation. For the client credentials flow, the customer's admin picks the run-as user in their org, so your onboarding has to collect the My Domain URL and confirm that user exists before the first sync. For JWT bearer, the admin must trust your certificate and pre-approve the user. Neither of these server-to-server flows lets a customer connect on their own from a button in your product. For a "Connect Salesforce" screen that customers use without your help, the web server flow with PKCE is still the better default. Our guide to connecting a SaaS product to many customer orgs covers that pattern.
API limits are per org, so a legacy sync design that is fine for one customer can exhaust a smaller one. Enterprise Edition gets 100,000 requests per 24 hours plus 1,000 per Salesforce license. Salesforce's own example is an org with 15 licenses, whose "request limit is 115,000 requests," per API Request Limits and Allocations. Worked from those documented numbers, a nightly ERP job that sends 40,000 changed orders as one REST call per record uses 40,000 requests. That is about 35% of the org's day. Bulk API 2.0 is the other option for files that size, and our Bulk API 2.0 guide covers its limits. The same job through sObject Collections, which can "add up to 200 records" per request, takes 200 requests. A poller that queries five objects every minute adds 7,200 requests a day before it moves any data. That allocation is shared with every other app the customer runs, so your design choices show up in their usage reports.
The run-as user also defines what your product can see. Because client credentials calls run as one user, field-level security and sharing on that user decide which records come back. When one customer reports missing data and the others don't, check that org's run-as user permissions before you debug the sync. Our guide to the Salesforce Integration user license covers the license and profile.
Mistakes that break legacy connections after go-live
- Pointing the token request at login.salesforce.com. The client credentials flow only accepts the org's My Domain URL, so a hardcoded login host fails on day one.
- Requesting a refresh token. The client credentials flow "doesn't support refresh tokens" and the JWT bearer flow "never issues a refresh token," per Salesforce Help. Request a new access token instead.
- Running the integration as a named employee. When that person leaves and is deactivated, every job stops. Use a dedicated API-only user.
- Treating outbound messages as an audit log. Salesforce states "You can't build an audit trail using outbound messaging," so pair it with a periodic reconciliation query.
- Relying on an IP allowlist for the on-premise listener. Salesforce writes "We discourage allowlisting because when IPs are added or changed, customers can experience connection interruptions," and points to mTLS instead, per KA 000384438.
- Leaving the username-password flow in place until February 2027. "If your org is created in Summer '23 or later, the username-password flow is blocked by default," per Block Authorization Flows to Improve Security, so newer customer orgs may already reject it.
Frequently Asked Questions
Can a legacy system still connect to Salesforce with a username and password?
Only until the username-password flow retires on February 20, 2027, and never through an external client app. Move to the client credentials flow or the JWT bearer flow.
Is client credentials or JWT bearer better for a server-to-server integration?
Client credentials is simpler and needs only a key and secret. JWT bearer keeps the secret off the network and suits systems that can sign tokens. Neither issues a refresh token.
Can a SOAP-only system use OAuth with Salesforce?
Yes. Put the OAuth access token in the SOAP SessionHeader instead of calling login(), which retires in Summer '27.
Can Appnigma build and maintain these integrations for our customers?
Yes. Appnigma's done-for-you service assigns a named integration engineer who builds each customer connection with the right APIs and authentication, then keeps it working as APIs change.
Related Articles
- What Is OAuth Authentication in Salesforce?
- How a SaaS Product Connects to Its Customers' Salesforce Orgs With OAuth
- Connected App vs External Client App in Salesforce
- Can You Use OAuth 2.0 With the Salesforce SOAP API?
- Salesforce Integration User License and Setup
- Salesforce ERP Integration Guide
Sources
- Salesforce Help, OAuth 2.0 Client Credentials Flow for Server-to-Server Integration
- Salesforce Developers, Metadata API Developer Guide, ExtlClntAppOauthConfigurablePolicies
- Salesforce Help, OAuth 2.0 JWT Bearer Flow for Server-to-Server Integration
- Salesforce Help, OAuth 2.0 Web Server Flow for Web App Integration
- Salesforce Help, Salesforce Security Roadmap (KA 005461287)
- Salesforce Developers, REST API Developer Guide, Authorization Through External Client Apps or Connected Apps and OAuth 2.0
- Salesforce Help, Comparison of Connected Apps and External Client Apps Features
- Salesforce Developers, SOAP API Developer Guide, login()
- Salesforce Developers, SOAP API Developer Guide, Core Data Types Used in API Calls
- Salesforce Developers, REST API Developer Guide, List Available REST API Versions
- Salesforce Developers, Integration Patterns and Practices, Remote Call-In
- Salesforce Developers, Integration Patterns and Practices, Remote Process Invocation, Request and Reply
- Salesforce Developers, SOAP API Developer Guide, Understanding Notifications
- Salesforce Developers, Platform Events Developer Guide, Subscribe to Platform Event Notifications with Pub/Sub API
- Salesforce Developers, Integration Patterns and Practices, Data Virtualization
- Salesforce Developers, Salesforce Developer Limits and Allocations Quick Reference, API Request Limits and Allocations
- Salesforce Developers, REST API Developer Guide, Create Records Using sObject Collections
- Salesforce Help, Block Authorization Flows to Improve Security
- Salesforce Developers, Metadata API Developer Guide, API End-of-Life Policy
- Salesforce Developers, Pub/Sub API, Pub/Sub API and the Expanded Event Bus
- Salesforce Help, Salesforce Core Services IP Addresses and Domains to Allow (KA 000384438)