> **Source:** https://knowledge.leegality.com/document-execution/integrations/salesforce/connect-and-authorize > **Site:** Leegality Knowledge Base — https://knowledge.leegality.com > **About:** Leegality is a document execution platform covering eSigning, stamps, NeSL, workflows, and REST API integration. > **Navigation:** Every article on this site has a plain-text version at `.txt` (this format). To get an index of all articles with their `.txt` links, read: https://knowledge.leegality.com/llms.txt > **AI Guide:** For instructions on how to navigate this knowledge base as an AI agent, read: https://knowledge.leegality.com/ai-readable.txt --- # Connect & Authorize Every user — admin or sender — connects their own Leegality account from within Salesforce before they can use the integration. This page covers how each role connects to each environment, and how environment redirection behaves. ## Admin authorization ### Connect as an admin 1. Log in to Salesforce with a user that has the **Leegality Admin User** permission set. 2. From the **App Launcher** (9-dot grid icon, top left), open the **Leegality for Salesforce** app, go to the **Authorization** tab, and click **Connect New Account**. 3. Choose the environment: - **Login with Sandbox** — connects to Leegality Sandbox. - **Login with App 1** — connects to Leegality Production. 4. A new tab tabs with the Leegality sign-in page. Enter your Leegality username and password — or sign in with OTP or SSO if enabled for your profile — and click **Sign In**. 5. You are redirected back to Salesforce with a message confirming successful authorization. ### Disconnect as an admin 1. Go to the **Authorization** tab. 2. Click **Disconnect**. 3. A message confirms that you are disconnected and can no longer use Leegality services. ## Sender authorization > **Info — Precondition** > > Senders need the **Leegality Sender User** permission set in Salesforce and valid Leegality credentials. The record they connect from must belong to an object with the Sender Modal on its page — see [Send Documents](https://knowledge.leegality.com/document-execution/integrations/salesforce/send-documents#add-the-sender-modal-to-a-record-page). 1. Navigate to any record of a mapped object (standard or custom). 2. In the **Leegality Workflows** section, click **Login to Leegality**. 3. If prompted, choose the environment (**Login with Sandbox** or **Login with App 1**). In many cases the environment is selected automatically — see [How environment redirection works](#how-environment-redirection-works). 4. A new tab opens with the Leegality sign-in page. Enter your credentials and click **Sign In**. 5. You are redirected back to the Salesforce record, and the record detail page shows a visual indication of the connection. ## How environment redirection works Which environment a sender lands in depends on what the org's admins are connected to: | Admin state | What the sender sees | | --- | --- | | One active admin, connected to an environment | Sender is automatically redirected to that same environment. | | Admin not connected to any environment | Sender is shown both environment options and chooses. | | Multiple active admins connected to **different** environments | Sender is shown both environment options and chooses. | | Multiple active admins connected to the **same** environment | Sender is automatically redirected to that shared environment. | Additional behavior to be aware of: - If a sender signs out and continues **without refreshing the page**, both environment options are shown — the system can't determine the admin's environment until the page reloads. - Admins and senders only see **workflows linked to the environment they are currently connected to**. An admin connected to Sandbox sees Sandbox workflows. - The **All Documents** table also follows the connected environment — an admin connected to Production sees documents initiated by production workflows, and vice versa. ## Authorization errors If you see an **`invalid_client`** error during authorization, the client secret configured in Salesforce is no longer valid. See [Troubleshooting](https://knowledge.leegality.com/document-execution/integrations/salesforce/troubleshooting#invalid_client-error-during-authorization) for the fix. ## Next step Once connected, admins can [import and link workflows](https://knowledge.leegality.com/document-execution/integrations/salesforce/workflow-management).