---
schema_version: "1"
id: 52f08f5f834f15eea2ce2a89c085099965e3d3c628f9a004e603175467eab1f8
title: Add Configuration Security by Using Named Credentials
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/platform/264-0-0/data_mask_using_named_credentials.md
canonical_url: https://help.salesforce.com/s/articleView?id=platform.data_mask_using_named_credentials.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: ecaa7d090d7488e553800cc658eef12c1fd1ecf411e5331c474fc1a68bb10ad6
description: If your organization requires heightened security when making configuration changes, enhance your Data Mask configuration security. Use a named credential with an Auth provider and a connected app to provide a secure connection to the Salesforce Metadata API. This feature is available in Data Mask version 4.2 and later.
products:
  - Salesforce Platform
release: "264"
---
# Add Configuration Security by Using Named Credentials

If your organization requires heightened security when making configuration changes, enhance your Data Mask configuration security. Use a named credential with an Auth provider and a connected app to provide a secure connection to the Salesforce Metadata API. This feature is available in Data Mask version 4.2 and later.

### 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: Lightning Experience</td></tr><tr class=""><td class="slds-cell-wrap" style="vertical-align:top;">Available in: <strong>Professional</strong>, <strong>Enterprise</strong>, <strong>Unlimited</strong>, and <strong>Developer</strong> Editions with the Salesforce Data Mask managed package (Legacy) add-on license.</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="d12255e68">User Permissions
              Needed</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="User Permissions Needed" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e68 ">To view named credentials:</td>

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

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

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

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

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-deploy_sandboxes-264-0-0-production-enus/654e51d1-6795-49fe-bd43-b5385950cf4a/images/icon_note.png)

Note This content relates to the Data Mask managed package. Read about Accelerate and Anonymize in [Own from Salesforce](https://help.salesforce.com/s/articleView?id=platform.own_from_salesforce.htm&type=5&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-platform-deploy_sandboxes-264-0-0-production-enus/654e51d1-6795-49fe-bd43-b5385950cf4a/images/icon_note.png)

Note Carefully note certain items during these procedures as required later: Your org’s URL, the generated callback URL, the Consumer Key, and the Consumer Secret.

Data Mask leverages the Metadata API to save configuration data. If your organization enabled the session setting Lock sessions to the IP address from which they originated, you can get an Invalid Session ID error. One solution is to disable the session setting, or use a named credential.

1. From Setup, enter External Client Apps in the Quick Find box, then select **Settings** in the External Client App section.
2. Turn on **Allow creation of connected apps**, if it's off.
3. Click **New Connected App**.
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="d12255e158">Field</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d12255e161">Description</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">Connected App Name</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">Data Mask API</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">API Name</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">
                  <p style="margin-bottom:0;">Data_Mask_API</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">Contact Email</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">Your email, if you’re the Administrator</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">Enable OAuth Settings</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">Select OAuth Settings.</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">Callback URL</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 "><var>https://example.com</var> (to be updated later)</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">Selected OAuth Scopes</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">Full Access (full), Perform requests at any time (refresh_token,
                  offline_access)</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">Require Proof Key for Code Exchange (PKCE) Extension for
                    Supported Authorization Flows</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">Enable</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">Require Secret for Web Server Flow</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">Enable</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 "><strong class="uicontrol">Require Secret for Refresh Token Flow</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">Enable</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e158 ">&nbsp;</td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e161 ">&nbsp;</td>

              </tr>
            </tbody>
          </table>
5. Save your changes.
6. To view and record the Consumer Key and Consumer Secret for later use, go to Manage Consumer Details.
7. To create an Auth Provider, from Setup, search for Auth Providers in the search box, and then click **New**.
8. 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="d12255e317">Field</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d12255e320">Description</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e317 "><strong class="uicontrol">Provider Type</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e320 ">Salesforce</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e317 "><strong class="uicontrol">Name</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e320 ">
                  <p style="margin-bottom:0;">Data Mask AP</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e317 "><strong class="uicontrol">URL Suffix</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e320 ">Data_Mask_AP </td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e317 "><strong class="uicontrol">Consumer Key</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e320 ">Use the Consumer Key you noted from the Connected App.</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e317 "><strong class="uicontrol">Consumer Secret</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e320 ">Use the Consumer Secret you noted from the Connected App.</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e317 "><strong class="uicontrol">Default Scopes</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e320 ">Add full, refresh_token, offline_access. (Don’t use commas to
                  separate.)</td>

              </tr>
            </tbody>
          </table>
9. Save the Auth Provider, and copy the Callback URL to a clipboard.
10. Edit the Connected App to include the Callback URL provided from the Auth Provider that you saved.
11. To create a named credential, from Setup, select Named Credentials **Named Credentials**, click the dropdown arrow next to New, and then select **New Legacy**.
12. 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="d12255e440">Field</th>
                <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d12255e443">Description</th>
              </tr>
            </thead>
            <tbody>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 "><strong class="uicontrol">Label</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">Data Mask NC</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 "><strong class="uicontrol">Name</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">
                  <p style="margin-bottom:0;">Data_Mask_NC</p>
                </td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 "><strong class="uicontrol">URL</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">The specific login URL for your org (not test.salesforce.com or
                  login.salesforce.com)</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 "><strong class="uicontrol">Identity Type</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">Named Principal</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 "><strong class="uicontrol">Authentication Provider</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">The name of the Auth Provider created earlier</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 "><strong class="uicontrol">Start Authentication Flow on Save</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">Enable</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 "><strong class="uicontrol">Generate Authorization Header</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">Enable</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 "><strong class="uicontrol">Allow Merge Fields in HTTP Body</strong></td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">Enable</td>

              </tr>
              <tr class="">
                <td data-label="Field" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e440 ">&nbsp;</td>

                <td data-label="Description" class="slds-cell-wrap" style="vertical-align:top;" headers="d12255e443 ">&nbsp;</td>

              </tr>
            </tbody>
          </table>
13. Save the named credential. It’s possible that you must log back into the org and approve the OAuth connection (Allow Access).
14. To update Data Mask Settings, from Setup, search for **Custom Settings**.
15. Locate Find and Manage Masking Configuration, and click **Manage**.
16. Under the Masking Configuration section, click **Edit**, and then enter the name of the named credential Data\_Mask\_NC in the Named Credential field (no spaces allowed).
17. Save the changes. Now, new or existing configurations are changed securely.