IDENTITY-AND-ACCESS-MANAGEMENT-ARCHITECT practice question 13 of 30

Universal Containers (UC) has a Customer Community that uses Facebook for of authentication. UC would like to ensure that changes in the Facebook profile are 65. reflected on the appropriate Customer Community user. How can this requirement be met?

Full set: 248 questions
Answer options
A: Use SAML Just-In-Time Provisioning between Facebook and Salesforce.
B: Use information in the Signed Request that is received from Facebook.
C: Develop a scheduled job that calls out to Facebook on a nightly basis.
D: Use the updateUser() method on the Registration Handler class. Correct answer
Correct Answer:
D. Use the updateUser() method on the Registration Handler class.
Explanation

When a user authenticates to a Salesforce Community via a third-party authentication provider like Facebook, Salesforce invokes a registration handler class. This Apex class, which implements the Auth.RegistrationHandler interface, contains two key methods: createUser and updateUser. The updateUser method is specifically executed when an existing user logs in. A developer can implement custom logic within this method to take the fresh profile data received from Facebook during the authentication flow and update the corresponding fields on the Salesforce User record, thus keeping the profiles synchronized at each login.

Why Incorrect

A. Use SAML Just-In-Time Provisioning between Facebook and Salesforce. Facebook authentication for Salesforce Communities uses the OpenID Connect protocol, not SAML. SAML Just-In-Time (JIT) provisioning is specific to SAML-based single sign-on integrations.
B. Use information in the Signed Request that is received from Facebook. A "Signed Request" is a specific mechanism for Facebook Canvas apps, not the standard authentication flow for external sites like a Salesforce Community. The user data is retrieved via an access token from the UserInfo endpoint.
C. Develop a scheduled job that calls out to Facebook on a nightly basis. This is an inefficient, non-real-time approach. The standard, event-driven method is to update the user's information during the login process itself using the registration handler, which is more secure and immediate.

References

1. Salesforce Developer Documentation

Auth.RegistrationHandler Interface:

"The updateUser method is called when a user has already been created in Salesforce from a third-party and logs in again. Use this method to update the user’s information from the third party."

Source: Salesforce Apex Reference Guide

Auth.RegistrationHandler Interface. (A search for "Auth.RegistrationHandler Interface" in the official Salesforce Developer documentation will lead to this page).

2. Salesforce Help

"Create a Registration Handler":

"When a user logs in to Salesforce from your third party

Salesforce checks if this user has been created in the org. If the user has been created

Salesforce calls the updateUser method and passes in the user object."

Source: Salesforce Help

Identity

"Create a Registration Handler".

3. Salesforce Trailhead

"External Identity for Customers":

The module on Social Sign-On explains the role of the Registration Handler in managing user data upon login. It details how the handler can be customized to create or update user records based on data from the social provider.

Source: Trailhead

"External Identity for Customers" module

"Set Up Social Sign-On" unit.

Scroll to Top