Newer Version Available
ConfirmUserRegistrationHandler Interface
Namespace
Usage
When you set up SSO with a third-party identity provider, you create a class that implements a registration handler using the Auth.RegistrationHandler interface. This class manages the process of creating and updating users. For advanced use cases that require you to confirm user information during the update process, implement the Auth.ConfirmUserRegistrationHandler interface in your class. This interface must be implemented in addition to Auth.RegistrationHandler.
You can use the Auth.ConfirmUserRegistrationHandler interface to ensure that users are mapped correctly between Salesforce and the third party. When a user who has previously logged in with an authentication provider logs in again, you can confirm that the incoming user data is consistent with the user's third-party identifier. If not, you can identify which user is supposed to be logged in.
You can also use the Auth.ConfirmUserRegistrationHandler interface to switch context for users with multiple records. For example, a user has two records—an admin user and a standard user. When the user logs in, the third-party identity provider confirms the account used to log in and sends the response to Salesforce via the UserInfo endpoint. You can then use this information to determine whether to log in the user as an admin or standard user.
ConfirmUserRegistrationHandler Methods
The following are methods for ConfirmUserRegistrationHandler.
confirmUser(userId, tpalId, portalId, userdata)
Signature
public Id confirmUser(Id userId, Id tpalId, Id portalId, Auth.UserData userdata)
Parameters
- userId
- Type: Id
- The ID of the user who is mapped to the third-party identifier via a third-party account link.
- tpalId
- Type: Id
- The third-party account link corresponding to the third-party identifier.
- portalId
- Type: Id
- The portal ID the user is logging in to. If there's no portal configured, this value can be null.
- userData
- Type: Auth.UserData
- Contains user information from the third-party identity provider.