Somewhere in most mature Salesforce orgs there is an integration that posts a username, a password and a security token to /services/oauth2/token with grant_type=password. It was the quickest way to get an access token when the integration was built, and it has worked quietly ever since.
That flow has a date. Salesforce enforces the retirement of the OAuth 2.0 username-password flow for connected apps on 20 February 2027. This post covers the timeline, how to find every integration that still depends on the flow (including the ones that do not show up where you would expect), and what to replace each one with.
The timeline
The change ships as a release update, Retirement of OAuth 2.0 Username-Password Flow for Connected Apps. It first appeared in Spring '26 and was originally scheduled for Winter '27, then moved to a fixed date. Related dates from Salesforce's connected app security roadmap:
| Date | Change |
|---|---|
| Summer '23 and later | New orgs have the username-password flow blocked by default |
| Summer '26 and later | New orgs cannot turn the flow on at all |
| 20 February 2027 | Username-password flow retired for connected apps; user-agent and hybrid flows retired the same day |
| Summer '27 | SOAP API login() retired for API versions 31.0 to 64.0 (details) |
External client apps never supported the username-password flow, so this only concerns legacy connected apps. Once the update is enforced, every integration that still requests a token this way stops getting one.
The SOAP login() retirement is a separate change with a later date, but it is the same problem: a stored password exchanged for a session. Inventory both at once.
Why the flow is going
The flow puts a user's password and security token in whatever system runs the integration: a middleware config screen, an environment variable, a properties file. The token request needs no browser, no consent screen and no MFA prompt, so anyone who copies those three values has the user's API access from anywhere the user's profile allows. The integration also breaks whenever someone resets that password, which is why these users often end up with passwords exempt from expiry and broad profiles.
Step 1: check whether the org even allows it
In Setup, open OAuth and OpenID Connect Settings and look at Allow OAuth Username-Password Flows. If it is off, the flow is already blocked in this org and any integration that tried it has been failing. If it is on, assume something uses it until you prove otherwise. Check every production org and every full sandbox, because they drift.
Step 2: find the logins, not just the apps
The obvious place to look is wrong. Salesforce's Login History documentation notes that connected apps using the username-password flow are not displayed on the Connected Apps OAuth Usage page, even with an active session. Login History is where they appear.
- In Setup, open Login History and create a list view.
- Add the Login Subtype, Application, Login Type and Username columns.
- Filter to OAuth logins and look for the username-password subtype.
- Download the history (it covers six months) and group by application and username.
To get the raw list of OAuth logins to review through the API:
sf data query --target-org prod --result-format csv --query "
SELECT UserId, LoginTime, Application, LoginType, SourceIp, Status
FROM LoginHistory
WHERE LoginTime = LAST_N_DAYS:30 AND LoginType = 'Remote Access 2.0'
ORDER BY Application" > oauth-logins.csvEach distinct application and user pair is a candidate. Run the review over a full month at least, so you catch jobs that only run at month end.
Step 3: search code and config
Logins tell you who, not where the credentials live. Search for the token request itself:
git grep -n -i "grant_type=password" -- . ':!node_modules'
git grep -n -i -E "security_?token" -- . ':!node_modules'Also check Apex that calls another Salesforce org, middleware and ETL connection settings that ask for a "password and security token", desktop tools configured by individual users, and scripts on shared servers. A field labelled "security token" in any connection screen is a strong sign the username-password flow (or SOAP login()) is behind it.
Step 4: pick the replacement
Salesforce's recommended replacements depend on who the integration acts as:
| Integration shape | Replace with | Notes |
|---|---|---|
| Server-to-server job acting as one integration user | Client credentials flow | Set a run-as user on the app; call your My Domain token endpoint, not login.salesforce.com |
| Server process that must act as several specific users, no browser | JWT bearer flow | Certificate-signed assertion; users must be pre-authorized for the app |
| A person signing in through an app | Web server flow with PKCE | The user signs in and consents in a browser, MFA applies |
A client credentials request is a single call with no password in it:
curl -s https://yourcompany.my.salesforce.com/services/oauth2/token \
-d grant_type=client_credentials \
-d client_id="$SF_CLIENT_ID" \
-d client_secret="$SF_CLIENT_SECRET"Build the replacement as an external client app, because creating new connected apps has been off by default since Spring '26. Give it a dedicated integration user with an API-only profile and a permission set scoped to what the job touches, restrict the app's permitted users, and add IP ranges if the caller has fixed egress addresses.
Step 5: cut over and close the door
Move one integration at a time and watch Login History for the old pattern to stop. When every integration is moved, reset the passwords of the old integration users (or deactivate them), then turn off Allow OAuth Username-Password Flows. Do this in a full sandbox first and let it run through a month-end cycle before production. Turning the setting off yourself, before February, means you find the stragglers on your schedule rather than on Salesforce's.
Checking it with Vulkro for Salesforce
vulkro-sf readiness joins a project or retrieved metadata against Salesforce's published enforcement dates. Row SF-READINESS-012 is the username-password retirement:
vulkro-sf readiness ./force-app --as-of 2027-03-01
vulkro-sf org oauth-risk --target-org prodThe readiness row is AT RISK when Apex in the snapshot posts grant_type=password or the retrieved OAuth settings still allow the flow, READY when the settings prove it is off, and UNKNOWN when the metadata cannot answer, with the Setup path to check by hand. It cannot see middleware outside Salesforce, and it says so. On a live org, org oauth-risk reports SF-OAUTH-CREATE-001 when the flow is still allowed, and org login-history reports SF-LOGIN-HISTORY-003 when an administrator authenticated with a username-and-password API login such as SOAP login(), which never prompts for MFA. Both read the org through your own sf CLI login and change nothing.
FAQ
When does the Salesforce username-password flow stop working?
Salesforce enforces the retirement for connected apps on 20 February 2027. Orgs created in Summer '26 or later cannot use the flow at all, and orgs created since Summer '23 have it blocked by default.
Does the retirement affect external client apps?
No, because external client apps never supported the username-password flow. A connected app that relies on it also cannot be migrated to an external client app until the integration moves to another flow.
What should a nightly ETL job use instead?
Usually the client credentials flow with a dedicated, least-privilege integration user set as the run-as user. If the job must act as several different users, use the JWT bearer flow with a certificate instead.
See the readiness reference and the Salesforce platform teams use case, or start a 14-day trial. Related: Salesforce integration users and least privilege and moving connected apps to external client apps.