1

I have set up a Named Credential with a linked External Credential following the instructions here The External Credential has a linked Permission Set with 2 Authentication Parameters, username and password. The username and password are referred to in a custom header.

This has been set up OK and works correctly in my scratch org. Since these credentials are not very secret (they access a dev environment for now) I would like to be able to retrieve them with sfdx cli and check them into git with the rest of the source and metadata. But the Authentication Parameters are missing. The External Credential and Permission Set are all present, just not the Authentication Parameters. How can I retrieve and redeploy them?

(later I will look at github secrets for the live environment authentication but not ready for that yet)

If this is not possible, what can be done to save admins from having to manually enter credentials to every single org on which this is to be deployed?

1 Answer 1

1

As of V57, these Authentication Parameters are not deployable via the Metadata API; For legacy Named Credentials, you can't retrieve a password via the MDAPI but can deploy it (e.g. from VCS)

Nominally, this is for good reason, the Named Credentials / External Credentials authentication values are kept by SFDC securely. They are not even inspectable by the system admin. Hence, deploying their values to a potentially insecure environment (GitHub) defeats the purpose of SFDC securely saving these values

3
  • Passwords can be deployed for Legacy Named Credentials. I have an implementation that at deploy time overrides the value set in the password property to use an injected value. This not being available for External Credentials is not ideal.
    – lpbearden
    Commented Nov 3, 2023 at 18:56
  • I think the MDAPI can't retrieve passwords but will deploy them from, say VCS XML files ..is that your experience? @ipbearden
    – cropredy
    Commented Nov 3, 2023 at 20:00
  • That's what I've seen as well. It will deploy them but not retrieve.
    – lpbearden
    Commented Nov 3, 2023 at 20:28

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .