> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Salesforce authentication guide

export const maia = "Maia";

This is a step-by-step guide to acquiring Salesforce credentials and authorizing the [Salesforce Load](/docs/components/salesforce-load) and [Salesforce Query](/docs/components/salesforce-query) components.

***

## Obtain Salesforce credentials

To create an OAuth connection to Salesforce, you need your Salesforce consumer key and consumer secret. In {maia}, these are referred to as your client ID and client secret.

To find these credentials, follow the steps in the Salesforce [View and Rotate the Consumer Key and Consumer Secret of a Connected App](https://help.salesforce.com/s/articleView?id=xcloud.connected_app_rotate_consumer_details.htm\&type=5) documentation until you can view these credentials. Keep this page open or copy and paste them somewhere so you can use them in the OAuth creation process in {maia}.

You *do not* need to generate new values for these credentials.

***

## Authorize Salesforce components

1. Follow the instructions in [OAuth](/docs/guides/oauth), and select **Salesforce** or **Salesforce Sandbox** in the **Provider** field, depending on whether you are connecting to a regular Salesforce account or a sandbox account.

2. In the **Authentication type** drop-down, select your authentication type:
   * Select **OAuth 2.0 Authorization Code Grant** to log in to Salesforce to authorize the connection. If you select this option, click **Authorize**, log in to Salesforce and complete the authorization process.
   * Select **OAuth 2.0 Client Credentials** to use your credentials. If you select this option, continue with the steps below.

3. In the **Token URL** field, enter your Salesforce token URL. This URL format differs depending on your Salesforce account type. Replace the placeholders with your domain name and sandbox name, as shown below:

   * For a regular Salesforce account: `https://{your-company}.my.salesforce.com/services/oauth2/token`
   * For a sandbox account: `https://{your-company}--{your-sandbox}.sandbox.my.salesforce.com/services/oauth2/token`

4. In the **Client ID** field, enter your Salesforce consumer key.

5. In the **Client secret** field, enter your Salesforce consumer secret.

   <Warning>
     When copying the credentials, some browsers may add a space to the end of the string. Watch out for this as it will cause the credentials to fail.
   </Warning>

6. Click **Authorize**.

Your new OAuth connection is ready for use with the [Salesforce Load](/docs/components/salesforce-load) or [Salesforce Query](/docs/components/salesforce-query) component.
