
## Set up username-password flow

URL: https://docs.atlan.com/apps/connectors/crm/salesforce/how-tos/oauth-username-password-setup

> Configure Salesforce username-password flow for Atlan integration.

:::warning Important
Atlan currently supports [Salesforce Sales Cloud](https://www.salesforce.com/eu/products/sales-cloud/) and [Financial Services Cloud](https://www.salesforce.com/in/financial-services/cloud/) (FSC).
:::

Atlan supports the Salesforce [OAuth 2.0 username-password](https://help.salesforce.com/s/articleView?id=sf.remoteaccess_oauth_username_password_flow.htm&type=5) flow for scenarios where server-to-server integration isn't possible. This flow enables Atlan to authenticate using the integration user's credentials along with a connected app in Salesforce.

## Prerequisites

Before you begin, make sure you have:

* Salesforce administrator access
* Network connectivity between Atlan and your Salesforce instance

## Create connected app

To enable Atlan to connect to your Salesforce instance, you need to create a connected app. This app provides the OAuth credentials that Atlan uses for authentication.

1. Log in to Salesforce.
2. In the upper right, click the **settings** **icon** and select **Setup**.
3. In _Setup_, enter `apps` in the _Quick Find_ box and select **App Manager**.
4. Click **New Connected App** in the upper-right corner.
5. Under _Basic Information_, provide:
 * _Connected App Name_: for example, `AtlanConnector`
 * _Contact Email_: your email address
6. Under _API (Enable OAuth Settings)_:
 * Check **Enable OAuth Settings**
 * Check **Enable for Device Flow**
 * Set _Callback URL_ to any domain, for example, `https://localhost` (unused)
 * Add the following _Selected OAuth Scopes_:
 - **Access Lightning applications (lightning)**
 - **Manage user data via APIs (api)**
 - **Perform requests at any time (refresh_token, offline_access)**
 * Check **Require Secret for Web Server Flow**
 * Check **Require Secret for Refresh Token Flow**
7. Click **Save**.
8. On the resulting page, click **Continue**.
9. Under _API (Enable OAuth Settings)_, click **Manage Consumer Details** and copy:
 * **Consumer Key (Client ID)**
 * **Consumer Secret (Client Secret)**
10. Wait approximately 10 minutes for the connected app to activate.

## Retrieve security token

Salesforce requires a security token in addition to your password for API access. You'll need to retrieve this token from your user settings and append it to your password when configuring the connection in Atlan.

1. In Salesforce, click the integration user's **user icon** in the upper-right and select **Settings**.
2. Expand _My Personal Information_ and click **Reset My Security Token**.
3. Click **Reset Security Token**.
4. Copy the resulting security token.

:::warning Important 
To [crawl Salesforce](https://docs.atlan.com/llms/connectors/salesforce/crawl-salesforce/llms.txt), enter your **password + security token** in the _Password_ field (for example, password `xyz` and token `123` → `xyz123`). 
:::

## Troubleshooting

If you encounter issues with Username-password authentication, see [Troubleshooting Salesforce Connectivity](https://docs.atlan.com/llms/connectors/salesforce/troubleshooting-salesforce-connectivity/llms.txt).

## Next steps

* [Crawl Salesforce](https://docs.atlan.com/llms/connectors/salesforce/crawl-salesforce/llms.txt): Configure and run your first crawl to discover Salesforce data and metadata

---
