+ Start a Discussion

Named Credentials Error (Couldn't Access Credentials)

Hello -  I am receiving this error when trying to connect to a second Salesforce org. 
System.CalloutException: We couldn't access the credential(s). You might not have the required permissions, or the external credential "SitCopyExternal" might not exist.

I have full CRUD on external credentials. Below is the named credential,  external credentials, and authentication provider. Any idea what's configured incorrectly? 
named credential
External credentials
auth provider
Sai PraveenSai Praveen (Salesforce Developers) 

The error may be because if any of the below reasons.

1) Make sure that the URL for the named credential is correct and that it matches the endpoint URL for the salesforce second  system you're trying to access.

2) Check that the username and password are correct and that they match the credentials you use to access the salesforce second  system

Let me know if you face any issues.

If this solution helps, Please mark it as best answer.

Hi Sai - Thanks for the response. Regarding #2, where do I enter username and password? 
Quick update here. The reason for the error is I didn't create a permission set. Once created, I was able to authenticate. Thanks again for the help.
User-added image 

You need to perform below steps-

1. Create a Principle in your named credential also add Authentication Parameters with some dummy data.
2. Open the permission set which is assigned to you and then add this Principle by clicking External Credential Principal Access.

after that try to perform callout