Loading

Migrate from OAuth 2.0 Username-Password Flow for Connected Apps

Udgivelsesdato: Oct 22, 2026
Beskrivelse

Salesforce is retiring the OAuth 2.0 Username-Password Flow for Connected Apps. Identify affected integrations and migrate to a supported authentication method before February 20, 2027, to avoid integration failures.

Description

As part of your security readiness activities, identify integrations using the Username-Password Flow and migrate them before the February 20, 2027 enforcement date.

When this update is enforced, integrations using this flow will stop working. Salesforce doesn't offer an extension or exception process for this enforcement date.

What to Do

1. Find Affected Integrations

  • Review Setup → Login History for OAuth Username-Password entries.

  • Review the Release Updates assessment in Setup for the Username-Password Flow retirement update.

  • Identify affected applications, integration owners, and dependencies.

  • Test your migration in a sandbox before deploying it to production.

2. Migrate to an External Client App

Migrate your existing Connected App to an External Client App (ECA), or create a new ECA configured for your chosen authentication flow.

Migrating to an ECA doesn't automatically change the authentication method. Configure and test a supported flow for your integration.

For more information, see Connected App to External Client App Migration.

3. Choose a Supported Authentication Flow

Client Credentials Flow

Use OAuth 2.0 Client Credentials Flow for server-to-server integrations when supported by your integration platform. The integration authenticates using the ECA consumer key and consumer secret instead of sending a Salesforce username and password in the token request.

A Salesforce integration user is still required. Configure the integration user's username in the ECA policy's Run As (Username) field. API access is governed by that user's permissions.

See OAuth 2.0 Client Credentials Flow.

Web Server Flow with PKCE

Use OAuth 2.0 Web Server Flow with the Proof Key for Code Exchange (PKCE) extension for interactive, user-facing applications that require end-user authorization.

See OAuth 2.0 Web Server Flow.

JWT Bearer Flow

Use OAuth 2.0 JWT Bearer Flow when the integration must act as a specific user using a signed JWT and certificate. Confirm that the integration platform supports this flow and that it meets your organization's security requirements.

See OAuth 2.0 JWT Bearer Flow.

When Standard OAuth Alternatives Don't Meet Your Requirements

Client Credentials Flow may not be suitable when organizational policy restricts client-secret authentication or when the integration platform cannot securely manage the required credentials. JWT Bearer Flow may not be suitable when certificate-based authentication or signed JWT generation isn't supported by the platform.

In these situations, work with your Salesforce and identity-security teams to evaluate an approved enterprise authentication architecture. Consider the following:

  • Identity and trust: Which system authenticates the integration, and how is its identity validated?

  • Token exchange: Does the architecture require an intermediary identity or token service before accessing Salesforce?

  • Credential protection: How are secrets, private keys, or certificates stored, rotated, and revoked?

  • Authorization: How is the Salesforce user context established, and how are API permissions controlled?

  • Operational controls: How are token expiry, renewal, failures, and audit events handled?

For enterprise environments that use a multi-stage token exchange, document the trust relationships and each token request and response. Validate the complete authentication sequence with the relevant identity and Salesforce security teams before selecting the migration approach.

4. Configure Client Credentials Flow

For an ECA using Client Credentials Flow, complete these steps in Setup:

  1. Open External Client App Manager and create a new ECA or open the ECA you intend to use.

  2. Enable OAuth Settings.

  3. Enable Client Credentials Flow.

  4. Set a callback URL. A value is required, although it isn't used by this flow.

  5. Add the Manage user data via APIs (api) OAuth scope.

  6. Save the configuration.

  7. Open the ECA policy settings and set Permitted Users to Admin approved users are pre-authorized.

  8. In Run As (Username), specify the exact username of the integration user.

  9. Save the policy.

  10. Open Manage Consumer Details, verify your identity if prompted, and copy the consumer key and consumer secret.

  11. Store the credentials securely. Don't hardcode the consumer secret in source code.

Verify that the integration user has only the permissions required for the integration.

5. Understand the Token Request Changes

When migrating from Username-Password Flow to Client Credentials Flow, the token request changes.

ParameterUsername-Password FlowClient Credentials Flow
grant_typepasswordclient_credentials
client_idRequiredRequired
client_secretRequiredRequired
usernameRequiredNot sent in the token request
passwordRequiredNot sent in the token request
Security tokenAppended to the password where requiredNot required
Salesforce user contextEstablished through the user credentials in the requestIntegration user configured in the ECA policy

Old token request

POST /services/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=password&
client_id=YOUR_CLIENT_ID&
client_secret=YOUR_CLIENT_SECRET&
username=YOUR_USERNAME&
password=YOUR_PASSWORD_AND_SECURITY_TOKEN

New token request

POST /services/oauth2/token
Content-Type: application/x-www-form-urlencoded

grant_type=client_credentials&
client_id=YOUR_CLIENT_ID&
client_secret=YOUR_CLIENT_SECRET

These examples illustrate the request parameters for each flow. URL-encode form values when constructing the actual request.

6. Test and Deploy the Migration

  1. Configure the ECA and selected authentication flow in a sandbox.

  2. Update the integration to use the new token request or authentication sequence.

  3. Test authentication, API access, effective user permissions, error handling, and token management.

  4. For enterprise token-exchange architectures, validate each authentication and token-exchange step.

  5. Repeat the approved configuration and deployment steps in production.

  6. Confirm that the production integration no longer depends on Username-Password Flow.

Important: February 20, 2027, is the published enforcement date. Complete the migration, security review, and production validation before this date.

Choose an Authentication Method

Integration requirementRecommended option
Server-to-server integration that supports client-secret authenticationClient Credentials Flow
Interactive, user-facing applicationWeb Server Flow with PKCE
Integration must act as a specific user using a signed JWT and certificateJWT Bearer Flow
Standard flows don't meet organizational security or platform requirementsAn approved enterprise authentication architecture, validated with Salesforce and identity-security teams

See Also

Vidensartikelnummer

005461976

 
Indlæser
Salesforce Help | Article