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:

  1. 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).
  2. Cost-Effective Licensing: It allows you to use a Salesforce Integration License instead of a full Salesforce License. Integration licenses are significantly cheaper and are often bundled with Salesforce subscriptions.
  3. 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.

NoteThis setup must be completed in Salesforce before changing the authentication settings in CloudFiles.

Setup Steps

Follow these steps to enable Client Credentials Flow:

  1. Go to Salesforce Setup
    • Log into your Salesforce org
    • Click on the gear icon and select "Setup"
  2. Navigate to External Client Apps
    • In the Quick Find box, search for External Client App
    • Click on "External Client Apps" from the results
  3. Select CloudFiles
    • Find and click on "CloudFiles" in the list of external client apps
  4. Edit OAuth Policies
    • Navigate to the "OAuth Policies" section
    • Click the "Edit" button
  5. Enable Client Credentials Flow
    • Check the box for "Enable Client Credentials Flow"
    • In the "Run As" field, specify the username of a user with a Salesforce Integration License (or any appropriate license)
    • 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.

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