How to Enable and Test External Credentials in Salesforce

How to Enable and Test External Credentials in Salesforce

Table Of Contents

How to Enable and Test External Credentials in Salesforce

Step-by-Step Guide to Set Up External Credentials in Salesforce

Step 1: Create a New External Credential

Step 2: Add a Principal to the External Credential

Step 3: Create a New Named Credential

Step 4: Enable Principal Access for Your Profile

Step 5: Test the Named Credential in Developer Console

What's there in Salesforce Summer '25 Changes

Conclusion

Salesforce’s new External Credentials model is a critical part of integration security moving forward, especially after the changes rolled out in Salesforce Summer ’25.  

Instead of embedding sensitive tokens or hardcoding values in Apex, you can now securely authorize callouts using External Credentials, Principals, and Named Credentials, with better control and auditing. 

In this guide, we’ll walk you through the step-by-step setup of External Credentials and Named Credentials with No Authentication and test the integration using the Developer Console.  

This is ideal for devs and architects who want secure, flexible callouts to external APIs usingSalesforce’s updated integration security model.

Step-by-Step Guide to Set Up External Credentials in Salesforce

Step 1: Create a New External Credential 

  1. Go to Setup 

  1. In the Quick Find box, search for Named Credentials 

  1. Click on the External Credentials tab 

  1. Click “New” 

Now fill out the form: 

  • Label: (Enter a descriptive label, e.g., NewEC) 

  • Name: (Auto-filled or enter as desired, e.g, NewEC) 

  • Authentication Protocol: Select No Authentication 

Click Save

 Step 2: Add a Principal to the External Credential 

Once saved, scroll down to the Principals related list: 

  1. Click “New.” 

  1. Add parameter name. Say, for instance, NewECPrincipal. 

  1. Click Save

Step 3: Create a New Named Credential 

  1. Go back to Named Credentials tab in the same setup screen 

  1. Click “New.” 

  1. Fill in the fields: 

  • Label: (e.g., NewNC) 

  • Name: (e.g., NewNC

  • URL: Enter your API endpoint.  

  • Click the checkbox for Enable for Callouts 

  • Under Authentication, select the External Credential you just created 

Click Save 

 Step 4: Enable Principal Access for Your Profile 

  1. Go to Setup → Profiles 

  1. Select the profile of the user making the callout, say System Administrator 

  1. Scroll down and click on “Enabled External Credential Principal Access.” 

  1. Click Edit 

  1. In the Available list, locate the External Credential → Principal pair you created 

  1. Move it to the Enabled list 

  1. Click Save 

This allows the user profile to use the Named Credential. 

 Step 5: Test the Named Credential in Developer Console 

  1. Go to the Developer Console 

  1. Open Debug → Open Execute Anonymous Window 

  1. Paste the following code: 

HttpRequest req = new HttpRequest();
    req.setEndpoint('callout:New_NC'); // Named Credential
    req.setMethod('GET');
    Http http = new Http();
    HttpResponse res = http.send(req); 

System.debug(res.getStatusCode()); 

Note: Replace 'Your_Named_Credential_Name' with the actual Name (not Label) of the Named Credential you created. 

  1. Run the code 

  1. Go to Debug Logs → View Last Log 

Congratulations! Everything is configured properly. You'll now see a response from the external API.


What's there in Salesforce Summer '25 Changes 

The Salesforce Summer ’25 features introduced more secure, granular controls for integrations via External Credentials and Principal Mapping. It’s now considered best practice over storing tokens in custom metadata or code. 

External Credentials in Salesforce let you manage integrations with different auth methods (including “No Authentication”) while ensuring you only expose access to trusted profiles or permission sets. 


Conclusion 

This guide shows you exactly how to set up and test External Credentials and Named Credentials in Salesforce the right way using the updated Summer ’25 features. It’s a cleaner, safer way to manage integrations and avoids the mess of hardcoded tokens. 

Want to customize this solution for your org? Or need help implementing it across multiple integrations?
Reach out today, and let’s get it done right!


Featured Reads

Want More Than Just Reading?

Talk to our consultants about how we can implement what you just read.