# Setting Up Client Credentials Flow for CloudFiles

By default, CloudFiles uses OAuth2.0 with user-based authentication to connect with Salesforce, but switching to Client Credentials Flow resolves several limitations of that approach.

> Kind: FAQ · Updated: Jul 4, 2026

## Overview

By default, CloudFiles uses OAuth2.0 with user-based authentication to connect with Salesforce. However, this approach has some limitations that can be resolved by switching to Client Credentials Flow.

## Why Use Client Credentials Flow?

Client Credentials Flow offers several advantages over the default user-based authentication:

- More Reliable Connection: The server-to-server connection doesn't require user reauthentication and won't be automatically disconnected by Salesforce after a period of time (typically 365 days).
- No Manual Login Required: The integration user doesn't need to log into Salesforce.com directly, as their credentials are only used for API access.

> **Note** — This setup must be completed in Salesforce before changing the authentication settings in CloudFiles.

## Setup Steps

Follow these steps to enable Client Credentials Flow:

- Go to Salesforce Setup
- Log into your Salesforce org
- Click on the gear icon and select "Setup"

- Navigate to External Client Apps
- In the Quick Find box, search for External Client App
- Click on "External Client Apps" from the results

- Select CloudFiles
- Find and click on "CloudFiles" in the list of external client apps

- Edit OAuth Policies
- Navigate to the "OAuth Policies" section
- Click the "Edit" button

- Enable Client Credentials Flow
- Check the box for "Enable Client Credentials Flow"
- In the "Run As" field, specify the user who has permissions outline here: Minimum Permission for CloudFiles Integration User, or username of the admin/integration user who had connected CloudFiles-Salesforce integration via the External Client App auth.
- Click "Save"

## Next Steps

Once you've completed these steps in Salesforce, you can proceed to update your authentication settings in CloudFiles to use the Client Credentials Flow.

A connected badge would appear after the connection via Client Credentials Flow has been established

![Salesforce Connection settings showing Client Credentials Flow selected with a Connected badge](https://media.help.cloudfiles.io/faq-setting-up-client-credentials-flow-for-cloudfiles-sf/client-credentials-connected-badge.png)

This configuration is recommended for production environments as it provides a more stable and cost-effective integration between CloudFiles and Salesforce.
