---
schema_version: "1"
id: c07ac6e4fa5e3bb26848d29ee55c483f3a5c05607fd1d86e9b6c82c3a6294f6b
title: Troubleshooting for Named Credentials
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/xcloud/264-0-0/nc_troubleshoot.md
canonical_url: https://help.salesforce.com/s/articleView?id=xcloud.nc_troubleshoot.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: 640f2854bee52f37801e41b67e9af963cef0a513c7e66422743012abd5851bc5
description: Review the potential causes and troubleshooting steps for common issues that you can encounter when you set up or use named credentials.
products:
  - Security
release: "264"
---
# Troubleshooting for Named Credentials

Review the potential causes and troubleshooting steps for common issues that you can encounter when you set up or use named credentials.

### 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 ">
        <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="d79619e58">Issue</th>
            <th scope="col" class="slds-cell-wrap" style="vertical-align:top;" id="d79619e61">Potential Causes and Troubleshooting Steps</th>
          </tr>
        </thead>
        <tbody>
          <tr class="">
            <td data-label="Issue" class="slds-cell-wrap" style="vertical-align:top;" headers="d79619e58 ">The external system returns the wrong HTTP response code.</td>

            <td data-label="Potential Causes and Troubleshooting Steps" class="slds-cell-wrap" style="vertical-align:top;" headers="d79619e61 ">
              <p>When callouts from Salesforce use invalid or expired credentials, some external systems
                return non-standard HTTP status codes, such as <code>400</code> or <code>601</code>, instead of the standard
                <code>401</code> response. To ensure that your callouts
                work, you can specify other 4<var>xx</var>, 6<var>xx</var>,
                7<var>xx</var>, 8<var>xx</var>, and 9<var>xx</var> HTTP
                status codes that trigger Salesforce to refresh access tokens.
              </p>
              <p style="margin-bottom:0;">From <a href="https://help.salesforce.com/s/articleView?id=xcloud.basics_nav_setup.htm&amp;type=5&amp;language=en_US" target="_blank">Setup</a>, use the Quick Find box to find and select
                <strong class="uicontrol">Named Credentials</strong>. Create or edit an external credential,
                and in the <strong class="uicontrol">Additional Status Codes for Token Refresh</strong> field,
                enter the 4<var>xx</var> status codes that your external system
                returns.
              </p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Issue" class="slds-cell-wrap" rowspan="2" style="vertical-align:top;" headers="d79619e58 ">Named credential callouts fail.</td>

            <td data-label="Potential Causes and Troubleshooting Steps" class="slds-cell-wrap" style="vertical-align:top;" headers="d79619e61 ">
              <p>To perform callouts using a named credential, users need access to:</p>
              <ul>
                <li>The principal that’s defined in the external credential. See <a href="https://help.salesforce.com/s/articleView?id=xcloud.nc_enable_ext_cred_principal.htm&amp;release=264.0.0&amp;type=5" title="Principals link an external credential to permission sets or user profiles so that users can make callouts using the named credential. At run time, Salesforce ensures that the user has the permission set before accessing the remote system.">Enable
                    External Credential Principals</a>.</li>

                <li>The user external credential that holds encrypted tokens to access the target endpoint.
                  Most standard permission sets and profiles have access to the User External
                  Credentials object by default. For the guest user profile, and for some custom
                  permission sets and profiles, you must assign User External Credentials object
                  permissions manually so these users can make authenticated callouts to external
                  systems. See <a href="https://help.salesforce.com/s/articleView?id=xcloud.nc_user_external_credentials.htm&amp;release=264.0.0&amp;type=5" title="Tokens for named credential callouts are encrypted and stored in the User External Credential object. Any user performing an authenticated callout needs profile- or permission set-based access to user external credentials. Most standard permission sets and profiles have access to the User External Credentials object by default. For the guest user profile, and for some custom permission sets and profiles, you must assign User External Credentials object permissions manually.">Enable User External
                    Credentials</a>.</li>

              </ul>
              <p style="margin-bottom:0;">Without both of these permissions, callouts can fail.</p>
            </td>

          </tr>
          <tr class="">
            <td data-label="Potential Causes and Troubleshooting Steps" class="slds-cell-wrap" style="vertical-align:top;" headers="d79619e61 ">
              <p>If you create a named credential for an installed managed package, you must allowlist the
                package’s namespace before it can make callouts. See <cite>Allowed Namespaces for
                  Callouts</cite> in <a href="https://help.salesforce.com/s/articleView?id=xcloud.nc_create_edit_named_credential.htm&amp;release=264.0.0&amp;type=5" title="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.">Create and Edit a Named
                  Credential</a>.</p>
              <p style="margin-bottom:0;">Named credentials that are created from Apex code in a managed package are disabled for
                callouts by default. To allow callouts using these named credentials, go to the
                named credential in Setup, and then turn on <strong class="uicontrol">Enabled for
                  Callouts</strong>. Be aware of security considerations when enabling callouts
                for named credentials that originate from Apex.</p>
            </td>

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

#### 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.")
- [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.")