Open registration
Users must log in to access your application (unless you have made pages public). You can add new users to your application by sending them an email invitation. Alternatively, you can enable open registration so that new users can create accounts without first being invited.
You can enable open registration for different authentication options, including signing in with a Google or Microsoft account. Open registration is useful when you want to allow:
- Anyone to be able to create an account in your application.
- Users to log in via a customer's SSO.
- All members of a particular organization to be able to log in when you don't have a list of all users or you do not want to send invitations.
When open registration is enabled, visitors to any of your application's non-public pages are redirected to the XXID login page. If the user selects an authentication option for which open registration has been enabled and they do not already have an XXID account, then a new account is created. When the user accesses your application, a new User case is created using their email address and/or any other details provided by the authentication provider.
For more information about XXID, including how to enable additional security measures or change the styling of the login page, see XXID.
Enable open registration from My Grexx
You can use My Grexx to enable open registration for a particular DTAP environment. You can only enable open registration using an existing Google or Microsoft account, or the user's email address and password.
To enable open registration:
- Open My Grexx and select the Settings page.
- Navigate to Advanced Settings > Open registration is allowed and edit the value for the relevant DTAP environment(s). The Set open registration form is displayed.
- Enable Allow open registration.
- In the Registration providers field, enter the relevant value(s):
google,microsoft, and/orusername/password. - Click Submit. The Open registration settings are updated for the selected environment.
- From your Studio, click the "compile" icon to apply the changes from My Grexx to your application, and then promote the changes to Testing, Acceptance, or Production as required.
It is not currently possible to enable open registration from your Studio using the options under Settings > Platform settings.
Collect additional user details
When a new User case is created via open registration, basic details (such as the user's email address) are provided by the authentication provider. You may want to ask new users to provide additional information (such as their display name or locale) as part of the onboarding process. You can do this by redirecting the user to a page that displays a form activity after they sign up.
For example, you can add a form activity to the User casetype and display it on a page using an activity widget and custom dataset:
- Create the form activity on the
Usercasetype so that new users can view and update their details.- Ensure the form contains the attributes that you want the user to be able to view and edit.
- Grant
Executerights to theProfile ownerplatform role.
- From the User casetype open the Start user activity and select the When done stage. Add an
Executetrigger for the new form activity. This ensures that the form activity will be generated as a mandatory task each time a new user is created. - Create a dataset that identifies mandatory tasks on the current user:
- Base the dataset on the
Mandatory tasks on platform without right checkdataset. - Add a column for
Task metadata>Case ID. This identifies the case to which the task belongs. - Add a column for
Activity metadata>ID. This identifies the activity on which the task is based. - Add a condition that compares the
Task case IDcolumn to the current user's case ID (using theuser.Current usertemplate function). This ensures the dataset only returns tasks on the current user. - Optionally add a second condition to return only tasks based on the form activity.
- Base the dataset on the
- Create a new page casetype to use as the landing page for users that have signed up via open registration.
- Edit the view for the page casetype and add an activity widget.
- From the Activity picklist, select the form activity that you added to the
Usercasetype. - From the Task dataset picklist, select the dataset that identifies tasks on the current user.
- Grant rights to view the widget to authenticated users.
- Add other widgets to the view as required. For example, you may want to use a template widget to display some additional text or images.
- From the User casetype, open the Start user activity. Add a mapping to change the newly created user's landing page to the page containing the activity widget:
- From the activity designer, select the
When donestage and add a mapping. - Set the mapping To attribute type to Casedata and then select Landing page.
- Set the mapping From attribute type to Inline template and then enter
page.and select the relevant page casetype.
- From the activity designer, select the
- Return to the form activity that you created in the first step, and use a mapping to change the user's landing page back to the homepage (or another page) so that once they have updated their details they are not asked to check them again:
- From the activity designer, select the
When donestage and add a mapping. - Set the mapping To attribute type to Casedata and then select Landing page.
- Set the mapping From attribute type to Inline template and then use the
page.template function to specify the landing page that the user will be redirected to each time they log in.
- From the activity designer, select the
For more information about form activities, see Edit case details. For more information about template functions, see Standard template functions.
You can use the user.user-session template function to retrieve additional information such as the user's locale, and any claims from the authentication provider. To populate the attributes on the User case with these values, add mappings to the When done stage of the Start user activity. By default, the activity form is populated with any existing values so that the user can view and edit them.
Add new users to roles
You may want to add users that have signed up via open registration to a platform role. For example, you might create a Guest user platform role so that you can grant users rights to view widgets and navigation items on the main pages in your application.
To add users to a platform role when a user has created an account via open registration:
- Create a page casetype (or use an existing
User managementpage or similar) and add a multivalue attribute to store the case IDs of users that you want to add to the role. - Create the role name and associated platform role, and link it to the page and attribute. For more information, see Configure user roles.
- Add a form activity to the page casetype to edit the platform role attribute.
- Trigger the form activity from the
Start useractivity:- From the User casetype, open the Start user activity and select the When done stage.
- Add an Execute and submit trigger, set the activity To type to Page, and then select the relevant page and form activity.
- Add a mapping to the On start stage of the trigger.
- Set the mapping From attribute type to Case metadata and then select Case ID. This identifies the case ID of the new
Usercase. - Set the mapping To attribute type to Task in and then select the form field for the platform attribute.
Each time a new user is added, the user will be added to the attribute on the page, and therefore to the platform role.