Salesforce signs users in with their production org account. It is the connector for products that sit next to a customer's CRM and want the same identity on both sides.

## Copy the redirect URI

In the [Authdog console](https://console.authdog.com), select the project and environment, open **Authentication > Providers**, find **Salesforce**, and click **Enable**. Copy the redirect URI shown in the form:

```url
https://identity.authdog.com/api/v1/callback/<connectionId>
```

## Create the connected app

1. In Salesforce **Setup**, open **App Manager** and select **New Connected App**.
2. Fill in the name, API name, and contact email.
3. Enable **Enable OAuth Settings**.
4. Under **Callback URL**, paste the redirect URI from Authdog.
5. Add the OAuth scopes **Access the identity URL service (id, profile, email, address, phone)** and **Perform requests at any time (refresh_token, offline_access)**.
6. Save. Connected app changes take a few minutes to propagate.
7. Open **Manage Consumer Details** and copy the **Consumer Key** and **Consumer Secret**.

## Configure Authdog

| Field | Value |
| --- | --- |
| **Client ID** | The Salesforce **Consumer Key** |
| **Client Secret** | The Salesforce **Consumer Secret** |

Save, then toggle the connection **active**.

## What Salesforce returns

Authdog requests the `openid email profile` scopes and reads the profile from `https://login.salesforce.com/services/oauth2/userinfo`.

The userinfo endpoint returns the user id, organization id, username, email, and display name.

This connector targets production orgs at `login.salesforce.com`. Use [Salesforce Sandbox](/docs/connectors/salesforce-sandbox) for `test.salesforce.com`, and [Salesforce Community](/docs/connectors/salesforce-community) for Experience Cloud sites on a custom domain.

## Test it

1. Open your environment's hosted sign-in page, or link to `https://identity.authdog.com/api/v1/signin/<connectionId>`.
2. Select the Salesforce button and complete the flow.
3. Confirm the user appears under **Users** in the console with a Salesforce identity linked.

## Troubleshooting

| Symptom | Cause |
| --- | --- |
| `OAUTH_APPROVAL_ERROR_GENERIC` | The connected app's policies block the user, or changes have not propagated yet |
| `invalid_client_id` | The consumer key belongs to a different org or a sandbox |
| Redirect or callback URL error | The URI registered with the provider does not match Authdog's exactly |
| Works in one environment only | Each environment has its own `connectionId`, and so its own redirect URI to register |

## Related

| Read | To learn how to |
| --- | --- |
| [Connectors](/docs/connectors) | Set up any other social provider |
| [Salesforce Sandbox](/docs/connectors/salesforce-sandbox) | Point the same setup at a sandbox org |
| [Salesforce Community](/docs/connectors/salesforce-community) | Sign in Experience Cloud users |
