You need to sign in to do that
Don't have an account?
MarkDenford
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?
Has anyone faced or overcome this, or know why salesforce is ignoring this setting?
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.
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