---
schema_version: "1"
id: afdccf9f2b6f70ac303d349a0877bcbb76f97c885da59440caf839bfd003330e
title: Create or Edit a Custom Authentication External Credential
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/nc_create_edit_custom_auth_ext_cred.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_custom_auth_ext_cred.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 8a2c11f5b878ba1ccc2adaaa26507ebcbd8897d824004aea18aeebbdf81d931b
description: To account for web service providers that use unique headers for authentication, create an external credential that uses the Custom authentication protocol.
products:
  - Security
release: "264"
---
# Create or Edit a Custom Authentication External Credential

To account for web service providers that use unique headers for authentication, create an external credential that uses the Custom authentication protocol.

### Required Editions

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small edition"><colgroup><col></colgroup><tbody><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: all editions</td></tr></tbody></table>

<table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small permission">
          <colgroup>
            <col style="width:50%">
            <col style="width:50%">
          </colgroup>
          <thead class="slds-text-title_caps ">
            <tr class="">
              <th scope="colgroup" class="slds-cell-wrap" colspan="2" style="text-align:center;vertical-align:top;" id="d69014e45">User Permissions
                Needed</th>
            </tr>
          </thead>
          <tbody>
            <tr class="">
              <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e45 ">To view external credentials:</td>

              <td class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e45 ">View Setup and Configuration</td>

            </tr>
            <tr class="">
              <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e45 ">To create, edit, or delete external credentials:</td>

              <td class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e45 ">Manage Named Credentials or Customize Applications</td>

            </tr>
          </tbody>
        </table>

If you choose Custom as your authentication protocol, you must specify a principal, sequence number, and authentication parameters. Each authentication parameter requires a name and value. Authentication parameters can be used in custom headers as a formula, for example, `$Credential.EC_dev_name.AuthParam_name`.

1. From [Setup](https://help.salesforce.com/s/articleView?id=xcloud.basics_nav_setup.htm&type=5&language=en_US), use the Quick Find box to find and select **Named Credentials**.
2. Click **External Credentials**.
3. To create a new external credential, click **New**. To edit an existing external credential, click its link in the list of external credentials, and then click **Edit**.
4. Complete the fields.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
              <colgroup>
                <col style="width:25%">
                <col style="width:75%">
              </colgroup>
              <thead class="slds-text-title_caps ">
                <tr class="">
                  <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d69014e119">Field</th>
                  <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d69014e121">Description</th>
                </tr>
              </thead>
              <tbody>
                <tr class="">
                  <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e119 "><strong class="uicontrol">Label</strong></td>
                  <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e121 ">A user-friendly name for the external credential that’s shown in the Salesforce user
                    interface, such as in list views.</td>
                </tr>
                <tr class="">
                  <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e119 "><strong class="uicontrol">Name</strong></td>
                  <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e121 ">
                    <p>A unique identifier that’s used to refer to this external credential from callout
                      definitions and through the API.</p>
                    <p style="margin-bottom:0;">The name can contain only underscores and alphanumeric
                      characters. It must be unique, begin with a letter, not include spaces, not end with an
                      underscore, and not contain two consecutive underscores.</p>
                  </td>
                </tr>
                <tr class="">
                  <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e119 "><strong class="uicontrol">Authentication Protocol</strong></td>
                  <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e121 ">Select <strong class="uicontrol">Custom</strong>. </td>
                </tr>
              </tbody>
            </table>
5. Save the external credential.
    
    You’re taken to the Named Credentials screen.

## Create Principals for Custom Authentication

After you create an external credential that uses custom authentication, create principals for it. These principals get mapped to permission sets and profiles.

1. On the Named Credentials page, click **External Credential**.
2. Select the external credential you created.
3. Scroll to Principals.
4. Click **New** to create a principal for this external credential, or choose **Edit** from the Actions menu of an existing principal.
    
    When editing an existing principal, not all the fields listed here are modifiable.
5. Complete these fields.
    
    <table class="slds-table slds-table_bordered slds-max-medium-table_stacked slds-m-bottom_small ">
                <colgroup>
                  <col style="width:25%">
                  <col style="width:75%">
                </colgroup>
                <thead class="slds-text-title_caps ">
                  <tr class="">
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d69014e204">Field</th>
                    <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d69014e206">Description</th>
                  </tr>
                </thead>
                <tbody>
                  <tr class="">
                    <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e204 "><strong class="uicontrol">Parameter Name</strong></td>
                    <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e206 ">Enter a name for the principal, such as <kbd>Admin</kbd> or
                      <kbd>Marketing Group</kbd>.
                    </td>
                  </tr>
                  <tr class="">
                    <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e204 "><strong class="uicontrol">Sequence Number</strong></td>
                    <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e206 ">Assign a sequence number. A sequence number specifies the order of principals to
                      apply when a user participates in more than one principal. For example, a user could be
                      part of multiple permission sets that are applicable for a credential provider. Priority
                      is from lower to higher numbers. </td>
                  </tr>
                  <tr class="">
                    <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e204 "><strong class="uicontrol">Identity Type</strong></td>
                    <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e206 ">
                      <p>This field defaults to Named Principal and can’t be modified.</p>
                      <p style="margin-bottom:0;"> A named principal
                        applies the same credential or authentication configuration for an entire
                        org.</p>
                    </td>
                  </tr>
                  <tr class="">
                    <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e204 "><strong class="uicontrol">Authentication Parameters</strong></td>
                    <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d69014e206 ">
                      <p>Click <strong class="uicontrol">Add</strong> to add your own <strong class="uicontrol">Name</strong> and
                        <strong class="uicontrol">Value</strong> authentication parameters.
                      </p>
                      <p>Declaring them here alone
                        doesn’t do anything in a callout, but you can use authentication parameters as variables
                        in request bodies and headers in Apex, and custom headers in named and external
                        credentials. For
                        example:</p>
                      <pre class="line-numbers slds-box slds-box_x-small slds-theme_shade slds-m-top_medium slds-m-bottom_medium slds-scrollable_x"><code>{!$Credential.<var>SampleCustomExternalCredential</var>.<var>myAuthParam</var>}</code></pre>
                    </td>
                  </tr>
                </tbody>
              </table>
6. Save the principal.
    
    You can’t modify the Principal Name and Identity Type of an existing principal. To change these parameters, delete the principal and recreate it.

Now that you created the external credential and its principal, it’s time to create the connected name credential. See [Create or Edit a Named Credential](https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_named_credential.htm&release=264.0.0&type=5 "Configure a named credential to specify the URL of a callout endpoint. To specify the required authentication parameters for the callout, connect the named credential to an external credential."). For an overview of all of the steps required to configure a named credential, see [Create Named Credentials and External Credentials](https://help.salesforce.com/s/articleView?id=xcloud.nc_named_creds_and_ext_creds.htm&release=264.0.0&type=5 "To simplify the setup of authenticated callouts, create an external credential to specify an authentication protocol and then specify a named credential as the callout endpoint. Add custom headers to cover more use cases and security requirements. Use a permission set or profile to grant access so that users can make authenticated callouts. You can create and configure named credentials programmatically or through the Salesforce UI.").

#### See Also

- [Named Credentials](https://help.salesforce.com/s/articleView?id=xcloud.named_credentials_about.htm&release=264.0.0&type=5 "Intended to secure and simplify authenticated API callouts to external systems, a named credential specifies the URL of a callout endpoint and its required authentication parameters in one definition. To streamline your Apex code and simplify the setup of authenticated callouts, specify a named credential as the callout endpoint.")