function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
MarkDenfordMarkDenford 

Salesforce ignites “Generate Authorization Header” setting in named credential with continuation

I’m developing an Apex callout using a continuation with the HttpRequest class. I’ve defined the Named Credential and turned off the “Generate Authorization Header” setting in the definition of the Named Credential. If I do the callout synchronously Salesforce doesn’t generate or include any Athorization header (as expected) and all is well. However if I do the callout using a Continuation Salesforce ignores this setting and still sends an Authorizarion header. This is causing 401 errors on my endpoint, I set the auth in a custom header, which is why I don’t want salesforce to generate that header. 

Has anyone faced or overcome this, or know why salesforce is ignoring this setting?
MarkDenfordMarkDenford
hmm typo in topic heading, I mean it "ignores" not "ignites", but ignites might be appropriate
Duncan Barr 2Duncan Barr 2
Hey mate,

Did you ever figure this one out? I'm having the same problem, and the only workaround I can think of is to Hardcode the url, which I'd prefer not to do.
MarkDenfordMarkDenford

Hey Duncan,

No resolution but an answer - we raised this as a case with Salesforce and it was confirmed as a bug and went to the R&D team. Where it's up to in terms of being fixed I don't know. I'm not at work at the moment but I'll try to find out the status in some sense. But it's a bug. It shouldn't happen. We ended up using synchronous callouts and then moving to oauth2 Auth provider so we didn't have to worry about this. Doesn't help you work around it but not sure there is any workaround until it's fixed.


Mark

Duncan Barr 2Duncan Barr 2
Thanks so much for your reply. That sucks. Hopefully they fix it. Duncan
Anurag Bahl 9Anurag Bahl 9
This was already fixed, but beyond a setting . Please reach out to salesforce support if you need it enabled for your ORG