0

I have a managed package with some apex code that makes a callout to a named credential. The named credential uses a username and password. This gets send in a header in the callout request as an authorization header and base64 encoded "username:password".

Testing this in my org works fine but when including the named credential in a managed package and installing to another org, the named credential works but the header comes through with a missing password: "username:*".

Why is this happening?

4

Since 2015 you have to add your named credentials again after installation. See Release Notes Spring 2015

After installation from a managed or unmanaged package, the subscriber must reauthenticate to the external system:

  • For password authentication, the subscriber must re-enter the password in the named credential definition.
  • So this need to be done manually in every org that installs the package? Obviously this isn't suitable for a package distributed publicly on app exchange? – rosghub Aug 12 '20 at 21:14
  • Nope its not the perfect solution for a managed package. Maybe you can take a look here trailhead.salesforce.com/en/content/learn/modules/… – utm Aug 12 '20 at 21:23

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.