My OpenApi 3.0 schema requires just a bearer token as authentication. Salesforce declarative Named Credential does not offer this as option. When using Password Authentication with a dummy username I understandably get a
404 Authentication Error.
Is there some kind of workaround using one of the supplied methods such as:
- JWT Token Exchange
- Oauth 2.0
that might be used as a workaround to avoid this error? The Salesforce PM responded in their portal stating an option for this is "on the roadmap"; however this is not helpful for today. The External Services Considerations state that
The standard HTTP request headers Accept, Content-Type, and Authorization are handled by the External Service and can't be overridden as OpenAPI operation input parameters. The Authorization header is set by the Named Credential.
Apex Named Credential would likely work; however this cannot be used with the declarative External Services which we are using in this case.