Skip to main content
Security

What is Named Credential in Salesforce?

A Named Credential securely stores the endpoint URL and authentication settings for an external service, letting Apex callouts reference a logical name instead of hard-coded credentials.

Clientell AI, the AI Salesforce admin, audits your Named Credential setup in a read-only scan, then drafts the fixes for you to approve. See permission management

Try it in Clientell AI

“Audit my Named Credential setup: show where access is too open, list who has more than they need, and draft fixes for me to approve.”

Clientell reads your org first, drafts every change, and changes nothing until you approve. Platform deployments include rollback. How security works.

Start the 14-day free trial, no card

Term Context

Category

Security

7 terms in this category

Related Terms

3

connected concepts

Glossary

66

total definitions

How does Named Credential work in Salesforce?

Named Credentials abstract away endpoint URLs and authentication logic from Apex code. Instead of storing passwords or tokens in custom settings or hard-coding them in Apex, developers reference a Named Credential by name, and Salesforce handles authentication automatically at runtime. This approach is more secure (credentials never appear in code or debug logs), more maintainable (changing an endpoint requires only a metadata update), and easier to migrate across environments.

The Named Credential framework supports multiple authentication protocols: Password Authentication (basic auth), OAuth 2.0 (client credentials, JWT bearer, authorization code), AWS Signature Version 4, and custom headers. Since the Summer '22 redesign, Named Credentials use a two-layer model: an External Credential defines the authentication protocol and principal, while the Named Credential specifies the endpoint URL and references the External Credential. Permission Set Mappings control which users can use which principals. Clientell AI uses Named Credentials for all external integrations it configures in your org, ensuring credentials are never exposed in code.

Questions people ask

What is a named credential in Salesforce?

A setting that stores the URL and login details for an outside service, so Apex and Flow can call it without hardcoded secrets.

How do I use a named credential in Apex?

Set the callout endpoint to callout: followed by the credential name and path. Salesforce adds the authentication for you.

What is an External Credential?

The newer part of the model that holds the authentication details, while the named credential holds the URL. They work together.

Why use a named credential instead of hardcoding a URL?

Secrets stay out of code, and you can change the endpoint per org without a deployment.

Getting Started

Try this on your own org

Start the 14-day free trial, no card. Clientell scans read-only first and changes nothing until you approve.

14-day free trial  ·  No credit card required

SOC 2
HIPAA
GDPR
Salesforce Partner