Setting up your development environment
To set up your development environment, you must create a Java project, such as an Eclipse project. The version of Eclipse that is supported is 3.2.1 or later.
The Rights Management SPI requires the edc-server-spi.jar file to be set in your project’s class path. If you do not reference this JAR file, you cannot use the Rights Management SPI in your Java project. This JAR file is installed with the AEM Forms SDK in the [install directory]\Adobe\Adobe_Experience_Manager_forms\sdk\spi folder.
In addition to adding the edc-server-spi.jar file to your project’s class path, you must also add the JAR files that are required to use the Rights Management Service API. These files are needed to use the Rights Management Service API within the Invite External Users Handler.
Defining the invite external users handler implementation
To develop an invite external users handler, you must create a Java class that implements the com.adobe.edc.server.spi.ersp.InvitedUserProvider interface. This class contains a method named invitedUser, which the Rights Management service invokes when email addresses are submitted using the Add Invited Users page accessible through administration console.
The invitedUser method accepts a java.util.List instance, which contains string-typed email addresses that are submitted from the Add Invited Users page. The invitedUser method returns an array of InvitedUserProviderResult objects, which is generally a mapping of email addresses to User objects (do not return null).
The implementation of the invite external users handler contains a user-defined method named createLocalPrincipalAccount. This method accepts a string value that specifies an email address as a parameter value. The createLocalPrincipalAccount method assumes the pre-existence of a local domain called EDC_EXTERNAL_REGISTERED. You can configure this domain name to be anything you wish; however, for a production application, you may want to integrate with an enterprise domain.
The createUsers method iterates over every email address and creates a corresponding User object (a local user in the EDC_EXTERNAL_REGISTERED domain). Finally, the doEmails method is called. This method is intentionally left as a stub in the sample. In a production implementation, it would contain application logic to send invitation email messages to the newly created users. It is left in the sample to demonstrate the application logic flow of a real application.
Defining the invite external users handler implementation
The following invite external users handler implementation accepts email addresses that are submitted from the Add Invited Users page accessible through administration console.
Defining the component XML file for the authorization handler
Fefine a component XML file to deploy the invite external users handler component. A component XML file exists for each component and provides metadata about the component.
The following component.xml file is used for the invite external users handler. Notice that the service name is InviteExternalUsersSample and the operation this service exposes is named invitedUser. The input parameter is a java.util.List instance and the output value is an array of com.adobe.edc.server.spi.esrp.InvitedUserProviderResult instances.
Defining the component XML file for the invite external users handler
Packaging the invite external users handler
To deploy the invite external users handler to AEM Forms, you must package your Java project into a JAR file. Ensure that the external JAR files on which the invite external users handler’s business logic depends, such as the edc-server-spi.jar and adobe-rightsmanagement-client.jar files are also included in the JAR file. As well, the component XML file must be present. The component.xml file and external JAR files must be located at the root of the JAR file.
BootstrapImpl class is shown. This section does not discuss how to create a BootstrapImpl class.The following illustration shows the Java project’s content that is packaged into the invite external users handler’s JAR file.
A. External JAR files required by the component B. JAVA file
Package the invite external users handler into a JAR file. In the previous diagram, notice that .JAVA files are listed. Once packaged into a JAR file, the corresponding .CLASS files must also be specified. Without the .CLASS files, the authorization handler does not work.
Testing the invite external users handler
To test the invite external users handler, you can add external users to invite by using administration console.
To add external users to invite using administration console:
-
Deploy the invite external users handler’s JAR file using Workbench.
-
Restart the application server.
NOTE
It is recommended to use the ‘Ctrl + C’ command to restart the SDK. Restarting the AEM SDK using alternative methods, for example, stopping Java processes, may lead to inconsistencies in the AEM development environment. -
Log in to administration console.
-
Click Services > Rights Management > Configuration > Invited User Registration.
-
Enable invited user registration by checking the Enable invited user registration box. Under Use Built-in registration system, click No. Save your settings.
-
From the administration console home page, click Settings > User Management > Domain Management.
-
Click New Local Domain. On the following page, create a domain with the name and identifier value of
EDC_EXTERNAL_REGISTERED. Save your changes. -
From the administration console home page, click Services > Rights Management > Invited and Local Users. The Add Invited User page appears.
-
Enter email addresses (because the current invite external users handler does not actually send email messages, the email addressed do not have to be valid). Click OK. The users are invited to the system.
-
From the administration console home page, click Settings > User Management > Users and Groups.
-
In the Find field, enter an email address that you specified. Click Find. The user you invited appears as a user in the local
EDC_EXTERNAL_REGISTEREDdomain.
Was this content helpful?
Announcements
Get hands-on with agentic AI.
Explore how AI agents work together through real examples and hands-on practice. Join your local User Group to design an agent workflow with your peers and leave with a practical framework you can apply to your own work.
Find an eventAdobe Experience Manager Roadmap Webinar, Part 2 (Forms, Cloud & Managed Services) - Americas & EMEA
Preview the AEM Forms, Cloud, and Managed Services roadmap. Ask the team live.
Adobe Experience Manager Roadmap Webinar, Part 2 (Forms, Cloud & Managed Services) - Americas & APAC
Preview the AEM Forms, Cloud, and Managed Services roadmap. Ask the team live.