I have an external REST API with an OpenAPI definition that I'd like to call from Salesforce via External Services + Flow. The external REST service needs a lot of extra stuff in the header for authentication.

I can connect with no problems in Apex and merge fields into Named Credential. How do I do this do in Flows with External Services using Named Credentials?

  • Out of the box, NC will generate the Authorization header with whatever options it's configured with. So your only solution is to use oAuth in NC as the auth protocol. You can then create a custom oAuth authentication provider and (if possible) force your authentication needs into this provider. You can then use NC with your Ext Svc. Your stuff is not oAuth? That's what "force" means.. Likely this approach won't work for you.
    – identigral
    Dec 3 '21 at 17:10
  • Are you thinking of creating an Auth Provider Plugin as in developer.salesforce.com/docs/atlas.en-us.apexcode.meta/… or a 3rd party custom auth provider as sort of a middlelayer? I've been digging around the doc but can't really grasp the concepts. I believe I only need to add a couple of extra JWT claims to the Named Credential Dec 6 '21 at 11:30
  • Yes, give it a shot.
    – identigral
    Dec 6 '21 at 15:10

Your Answer

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

Browse other questions tagged or ask your own question.