Add custom headers to external credentials to cover more use cases and security requirements. With custom headers, you can set your own parameters for authentication.
Required Editions
| Available in: both Salesforce Classic (not available in all orgs) and Lightning Experience |
| Available in: all editions |
Custom headers are a way for a remote system to define parameters it needs as input to respond to a request. Using a custom header is similar to having a function in a piece of code and defining input parameters or arguments that allow the caller to provide input.
You can add custom headers to named credentials and external credentials. In most cases, it’s best to associate headers with the external credential, rather than the named credential, because external credentials are meant to encapsulate authentication details. For example, define custom authorization headers in an external credential to use consistent authentication across all named credential endpoints using the same external credential.
- Use Cases for Custom Headers with Named Credentials
Custom headers are most often used for security or authentication purposes. The HTTP standard includes a commonly used, dedicated Authorization header. However, many use cases require something else. Two common use cases are per-user callouts and API keys. - Create and Edit Custom Headers
Use custom headers to make unique secure connections to external data sources. - Use API Keys in Custom Headers with Named Credentials
Web services often define their own authentication protocols using custom headers. For those cases, you can create a custom header for a named or external credential and use API keys as a password. - Use Named Credential Formula Functions in Custom Headers
Formula functions can be used in the value field of a custom header of a named credential or external credential. - Use Custom Headers for Basic Authentication with Named Credentials
Create an external credential with a custom header that uses HTTP Basic authentication.