> **Source:** https://knowledge.leegality.com/document-execution/integrations/salesforce/installation-and-setup > **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 --- # Installation & Setup This page walks a Salesforce administrator through the one-time setup: installing the managed package, configuring credentials, and assigning permission sets. Complete the steps in order. > **Info — Before you start** > > Keep your Leegality **Client ID** and **Client Secret** handy for each environment you plan to connect. These are provided by Leegality — contact your Leegality account manager if you don't have them. ## Step 1: Install the managed package 1. Log in to your Salesforce org as a System Administrator. 2. Open the installation page for the Leegality managed package. 3. Choose **Install for Admins Only**. 4. Check the box **I acknowledge that I'm installing a Non-Salesforce Application that is not authorized for distribution as part of Salesforce's AppExchange Partner Program**. 5. Click **Install**. You are taken to the third-party access approval step. 6. All third-party access options are selected by default. Review them and check **Yes, grant access to these third-party websites**. 7. Click **Continue** to complete the installation. ## Step 2: Configure credentials The package calls Leegality APIs through Salesforce **Named Credentials**. You'll create an External Credential (which stores the Client ID and Secret), a Named Credential (which points to the Leegality gateway URL), and a permission set that lets users access the credential. Set up the environments you need — sandbox for testing, production for live use. The steps are identical; only the names, URLs, and credential values differ. ### 2.1 Create External Credentials 1. Click on the Gear icon (⚙️) on the top right corner to open **Setup Menu**. 2. Click **Setup** and a new tab will open. 3. Search for **Named Credentials**, and open it. 4. Click the **External Credentials** tab, then click **New**. 5. Based on the environment, enter: - For **sandbox** environment - **Label:** `LEEGALITY_SANDBOX_EC` - **Name:** `LEEGALITY_SANDBOX_EC` - For the **production** environment - **Label:** `LEEGALITY_PRODUCTION_EC` - **Name:** `LEEGALITY_PRODUCTION_EC` 6. **Authentication Protocol:** Custom 7. Click **Save**. > **Info — Separate environment-specific configuration** > > You need to add separate external credentials for Sandbox and Production environment. ### 2.2 Add Principals to the External Credentials 1. Open the External Credential (`LEEGALITY_SANDBOX_EC` or `LEEGALITY_PRODUCTION_EC`). 2. Scroll to the **Principals** section and click **New**. 3. Enter: - **Parameter Name:** Add an appropriate name e.g. `LeegalityCredentials` - **Sequence Number:** `1` - **Identity Type:** Named Principal 4. Click **Save**. 5. Click **Edit** on the principal you just created. 6. Under **Authentication Parameters**, click **Add** and enter: | Parameter Name | Value | | --- | --- | | `client_id` | Your Leegality Client ID for this environment | | `client_secret` | Your Leegality Client Secret for this environment | 7. Click **Save**. > **Caution** > > Use the **sandbox** Client ID/Secret in `LEEGALITY_SANDBOX_EC` and the **production** Client ID/Secret in `LEEGALITY_PRODUCTION_EC`. Mixing them up will cause authorization failures. ### 2.3 Create Named Credentials 1. Go to **Setup → Named Credentials → Named Credentials** tab and click **New**. 2. Enter the values for your environment — use the **Production** column for production and the **Sandbox** column for sandbox: | Field | Production value | Sandbox value | | --- | --- | --- | | **Label** | `LEEGALITY_PRODUCTION` | `LEEGALITY_SANDBOX` | | **Name** | `LEEGALITY_PRODUCTION` | `LEEGALITY_SANDBOX` | | **URL** | `https://api-gateway.leegality.com` | `https://sandbox-gateway.leegality.com` | | **Enabled for Callouts** | ✅ Checked | ✅ Checked | | **External Credential** | `LEEGALITY_PRODUCTION_EC` | `LEEGALITY_SANDBOX_EC` | | **Generate Authorization Header** | ❌ Unchecked | ❌ Unchecked | | **Allow Formulas in HTTP Header** | ❌ Unchecked | ❌ Unchecked | | **Allow Formulas in HTTP Body** | ✅ Checked | ✅ Checked | | **Allowed Namespaces for Callouts** | `LeegalityforSF` | `LeegalityforSF` | 3. Click **Save**. 4. To set up both environments, click **New** again and repeat with the other column's values. > **Caution** > > Create the credentials with the **exact names shown above**. The package references them by name — a typo results in an "Unauthorized endpoint" error later. ### 2.4 Grant credential access to users Users need access to the External Credential principals before they can use the integration. **Create the permission set:** 1. Go to **Setup**, search for **Permission Sets**, and open it. 2. Click **New** and enter: - **Label:** `Leegality External Credential Access` - **API Name:** `Leegality_External_Credential_Access` 3. Click **Save**. 4. In the new permission set, click **External Credential Principal Access → Edit**. 5. Move the following to **Enabled External Credential Principals**: - `LEEGALITY_SANDBOX_EC - LeegalityCredentials` - `LEEGALITY_PRODUCTION_EC - LeegalityCredentials` 6. Click **Save**. **Assign it:** 1. Go to **Setup → Permission Sets** and open **Leegality External Credential Access**. 2. Click **Manage Assignments → Add Assignment**. 3. Select every user who will use Leegality (admins and senders), then click **Assign**. ### 2.5 Verify the credential setup Confirm the credentials work by signing in to a Leegality environment from the app. A successful OAuth login means the External and Named Credentials are configured correctly. 1. Click the **App Launcher** (9-dot grid icon, top left), search for *Leegality*, and select **Leegality for Salesforce** to open the app. 2. Go to the **Authorization** tab. 3. Click **Connect New Account** and select your environment (Production / Sandbox). 4. Complete the OAuth flow. If you hit an error here, see [Troubleshooting](https://knowledge.leegality.com/document-execution/integrations/salesforce/troubleshooting#credential-setup-errors). ## Step 3: Assign Leegality permission sets The package ships with two permission sets that define what users can do inside the app. ### Make a user an Admin Assign the **Leegality Admin User** permission set to every System Admin (or any user who will link workflows and manage the integration): 1. Go to **Setup → Users** and select the user. 2. Under **Permission Set Assignments**, click **Edit Assignments**. 3. Select the **Leegality Admin User** permission set. 4. Click **Save**. ### Make a user a Sender 1. Open the **Leegality for Salesforce** app and go to the **User Management** tab. 2. Select **Permission Set** and choose **Leegality Sender User**. 3. Click **Manage Assignment → Add Assignment**. 4. Select the user(s) you want to add as senders and confirm. > **Info — note** > > You can also manage both permission sets later from the app's **User Management** tab — see [Administration](https://knowledge.leegality.com/document-execution/integrations/salesforce/administration#user-management). ## Next step With installation and permissions in place, [connect and authorize with a Leegality environment](https://knowledge.leegality.com/document-execution/integrations/salesforce/connect-and-authorize).