Salesforce has updated the OAuth 2.0 Client Credentials flow in the Winter β26 Release to return a clear error when a token request has no valid scopes. This makes debugging integration issues much simpler.
π The Change
When a token request is made using grant_type=client_credentials and Salesforce finds that none of the effective scopes are supported, it now returns the following descriptive error:
{
"error": "invalid_grant",
"error_description": "no valid scopes defined"
}
What It Means
- Applies only to the Client Credentials flow β other OAuth 2.0 flows are unaffected.
- If a request includes both supported and unsupported scopes, Salesforce drops the unsupported ones and issues a token for the valid scopes.
- If all scopes are unsupported, Salesforce rejects the request with the error above.
Unsupported scopes (examples):
fullβ Full accessrefresh_token/offline_accessβ Perform requests at any time
Typical supported scope for integrations:
apiβ Manage user data via APIs
π§ Release Timeline
This update is part of Salesforce Winter β26, with production rollouts starting September 19, 2025.
β Why You Might See This Error
Many integrations using the Client Credentials flow donβt send the scope parameter β and thatβs fine.
In such cases, Salesforce uses the scopes configured in the Connected Appβs Selected OAuth Scopes section.
If that Connected App contains only unsupported scopes, the request resolves to no valid scopes, resulting in:
invalid_grant: no valid scopes defined
β
Fix: Ensure at least one supported scope (like Manage user data via APIs (api)) is selected in your Connected App, even if your integration doesnβt explicitly send a scope.
π§ How to Find and Fix
Step 1: Inventory
- Identify all integrations using
grant_type=client_credentials(e.g., Named Credentials, middleware, background jobs). - Locate the corresponding Connected Apps.
- Review their Selected OAuth Scopes.
Step 2: Remediate
- Go to Setup β App Manager β Manage Connected Apps β [App Name] β Edit Policies
- Under Selected OAuth Scopes, add:
- Manage user data via APIs (api)
- Remove unsupported scopes (
full,refresh_token, etc.). - Ensure the Run As user has:
- API Enabled
- Required object CRUD/FLS permissions
Step 3: Add Guardrails
- Donβt send
scopein the request β rely on Connected App scopes. - Monitor for token errors containing
invalid_grantand βno valid scopes defined.β - Document your Connected App scope policy and integration user permissions.
π§ Summary
| Area | Details |
|---|---|
| Applies To | Only OAuth 2.0 Client Credentials Flow |
| Change | New descriptive error for missing valid scopes |
| Release | Winter β26 (starts Sep 19, 2025) |
| Impact | Token requests with unsupported scopes now fail clearly |
| Fix | Add Manage user data via APIs (api) to Connected App scopes |
| Best Practice | Rely on Connected App configuration instead of sending scope |
π‘ Pro Tip
If youβre using Azure Logic Apps, MuleSoft, Boomi, or Postman collections with grant_type=client_credentials, review your Connected Apps now and ensure at least one supported scope is configured before Winter β26 rolls out.
π Final Thought
This update impacts only the Client Credentials flow, improving clarity for integration developers.
By ensuring every Connected App includes the api scope, youβll keep your machine-to-machine integrations running smoothly through Winter β26 and beyond.
Leave a comment