I have requirement to encrypt the password that is stored in Named Credentials when making call out to external system.

So I'm planning to use AES256 encryption algorithm from crypto class. But is it possible to apply this algorithm on namedCredentials?

  • Rama, why do you want to encrypt Naming credentials? Salesforce manages them so that you don't need to. – ytiq Dec 27 '19 at 11:53
  • I believe if I do not encrypt the password, external application to which I'm making callout receives the password in plain text format, also 'in transit' password will be in unencrypted format. Our external application wants to receive the password in encrypted format, so they can decrypt it and authorize the user. – Rama Dec 27 '19 at 18:07

No you cannot encrypt them. In order to complete the flow you would need the correct unencrypted password. Additionally there is no functionality to use the merge fields or normal process where you would be able to decrypt.

If you must encrypt them you will need to use custom metadata or custom settings and build the oAuth process yourself.

Be aware that users with customize application permission can view named credentials, so if your security policy requires that the secrets be hidden from subscribers, then please use a protected custom metadata type or protected custom setting

Storing Sensitive Data

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.