Customize Registration Handler - Customize Registration Handler - Alfresco - Alfresco Content Connector for Salesforce - Alfresco/Alfresco-Content-Connector-for-Salesforce/2.4/Alfresco-Content-Connector-for-Salesforce/Alfresco-Content-Connector-for-Salesforce/Configure-Salesforce-Connector/Configure-SSO-for-Salesforce/Customize-Registration-Handler - 2.4

Alfresco Content Connector for Salesforce

Platform
Alfresco
Product
Alfresco Content Connector for Salesforce
Release
2.4
ft:lastPublication
2026-05-06T14:48:53.777000
ft:locale
en-US
ArchiveStatus
Archived

Configuring the registration handler should be completed by someone with an understanding of Apex, Salesforce SSO, and your identity provider. Below is a sample approach for a simplified implementation using the default template. This should not be used for production as it may not meet your specific needs. We encourage testing to validate that your registration handler is configured correctly. This is not a definitive guide on how to customize the registration handler.

  1. To update the Apex code, in the newly created Auth. Providers window click the link next to Registration Handler to open the Apex classes window.

  2. Click Edit and change the generate Global Class name to something more meaningful to you such as IdentityServiceRegistrationHandler.

    The generated name will be something like AutocreatedRegHandler1624989012775.

  3. Comment out all references to the method canCreateUser(Auth.UserData data).

    If the method references are not commented out, you will not be able to log in through your provider because a new user will not be created. The method is false by default.

  4. In the createUser method, change the value of the string @myorg.com to be the email domain as specified in your identity provider within the section where a standard user object is instantiated. To do this within the Apex code:

    • Find u.username = data.username + '@myorg.com' and add your domain instead.
    • If your providers username is formated as an email address, change the line to be u.username = data.username.

Note

In the example above, a new Salesforce user is created at login through your provider. If you are attempting to match an existing Salesforce user, the same createUser method is called, but the Registration Handlers Apex code should be updated to use some combination of identifiable values from your provider to query Salesforce to find user values to identify, and return an existing user instead of attempting to create a new user.

Note

You can configure the Apex code in lots of different ways to suit your organization. See the Salesforce documentation for more information: