INTEGRATION-ARCHITECTURE-DESIGNER practice question 22 of 25

An Architect is required to integrate with an External Data Source via a Named Credential with an Apex callout due to technical constraints. How is authentication achieved?

Full set: 106 questions

Domain Design a Security Solution

Answer options
A: Handle authentication with login flows.
B: Handle authentication in the code. Correct answer
C: Connect via Salesforce Connect.
D: Connect via Communities.
Correct Answer:
B. Handle authentication in the code.
Explanation

A Named Credential abstracts the endpoint and authentication from the code. While it natively supports standard protocols like OAuth 2.0 and Basic Auth, it also allows for custom authentication schemes to meet specific technical constraints. This is achieved by creating a custom authentication provider using an Apex class that implements the Auth.AuthProviderPluginClass interface. This Apex class contains the specific logic for handling the authentication handshake. The Named Credential is then configured to use this custom Apex-based provider, meaning the authentication logic is ultimately handled in code.

Why Incorrect

A. Handle authentication with login flows. Login flows are used to customize the user login experience into Salesforce. They do not handle the authentication protocol for outbound API callouts to external systems.
C. Connect via Salesforce Connect. Salesforce Connect is a data virtualization framework for accessing external data with external objects. It is a distinct integration pattern and not used for making Apex callouts.
D. Connect via Communities. Communities (Experience Cloud) are portals for external users (customers, partners). This feature is unrelated to handling authentication for outbound system-to-system integrations via Apex.

References

1. Apex Developer Guide

Auth.AuthProviderPluginClass Interface:

Section: Auth.AuthProviderPluginClass Interface

Content: The official documentation details how to "Create a custom authentication provider by extending the Auth.AuthProviderPluginClass abstract class." This confirms that custom authentication logic can be written in Apex code to be used by the Salesforce authentication framework.

2. Salesforce Help

Create a Custom Authentication Provider:

Section: Create a Custom Authentication Provider

Content: This guide explicitly states

"To use an authentication protocol that Salesforce doesn’t support out of the box

you can create a custom authentication provider. With a custom authentication provider

you can handle the authentication yourself with an Apex class..."

3. Salesforce Help

Define a Named Credential:

Section: Define a Named Credential

Content: When defining a Named Credential

the "Authentication Protocol" field includes options for standard protocols and any custom Authentication Providers created in the org. This directly links the Apex-coded custom provider to the Named Credential configuration.

Scroll to Top