Create a Custom User Registration Process
This article deals with the following topics:
Overview
Luma provides Administrators a configurable approach to registering users in Luma and associate them with the required chat channels. Administrators can register users through email (available out-of-the box see Register Users through Email), SMS or another approach of their choice. When a new user sends a message to Luma from any chat channel, Luma needs to associate that user's chat account with their Luma account. The user will be prompted for association with or without validation. After successful association, the user's chat account is mapped to their Luma account. The default role associated to users after registration is Self Service User.
The Luma platform provides several key API components that can be used for a custom registration process including the following:
- Check if a user already exists in Luma
- Check if a user is authenticated in the Channel
- Create a new user
- Update Global Attributes for a user
For more information on all of these components see APIs for User Registration.
Register and Associate users through an SMS One Time Password
The following is an example of a user registration process that prompts the user for their mobile number, if their mobile number is associated with an existing active Luma account, a one time password (OTP) will be sent to their phone number. Once the number is entered the user's chat channel account is successful associated with their Luma account and they can interact with Luma.
See the diagram below to view the full workflow of this process.
- Overview of Attributes
- Creating your First Skill
- Overview of Web Services
- Post Fulfillment Actions
- Skill Execution via Conditional Branching
This sample user registration process uses the following skills:
- Custom user registration (custom skill)
- getContactsFromLuma (custom skill)
- IsUserAuthenticatedToChannel (custom skill)
- Select OTP action (custom skill)
- Provide OTP (custom skill)
- Resend OTP (custom skill)
- Luma Channel Association (system skill)
The following sample walks you through the steps to configure the skills for user registration by prompting the user for their mobile number. However, your custom registration process may contain more or less skills depending on your configuration. To create a custom registration process which involves prompting the user to enter their mobile number, do the following:
- Create a custom skill for user registration with the attributes to prompt the user to enter the email ID, phone number or username. In this sample, the skill name used is custom user registration.
- Add ‘mobile_number’ attribute as conversation parameter to prompt the user to enter their mobile number as shown below. For this process, use the APIs for User Association.
- Add ‘mobile_number’ attribute as conversation parameter to prompt the user to enter their mobile number as shown below. For this process, use the APIs for User Association.
- When the user enters their phone number, Luma needs to validate whether the entered mobile number is associated to a Luma contact. For this process, use the API to check if user is authenticated in the channel.
- Add a rule which triggers the skill to check whether the user entered mobile number is associated to any user in Luma. This is done by using the webservices. Refer Overview of Web Services to know more about web services.
Create a web service to check whether the user exists in Luma and use it in an attribute. Use that attribute in the skill as shown in the following images.
Note
Reconciliation key can be username, first name, last name, mobile number or email address.
- Post validating whether the user entered mobile number is associated to an existing user in Luma, perform another validation to check if the user is already authenticated in the channel. This check is done using the webservice call 'user authenticated check'. To know how to create a webservice, refer Overview of Web Services. It verifies whether the user is associated with the respective channel. For this, the following example uses the attribute name as isUserAuthenticated, and the skill name as IsUserAuthenticatedToChannel.
- Add a rule in Luma to validate whether the provided mobile number is associated to a Luma contact as shown below.
- If the user is already authenticated in the chat channel, then the following error message will be displayed ''You are already authenticated in the channel'' followed by displaying the welcome skills.
- Add a rule which triggers the skill to check whether the user entered mobile number is associated to any user in Luma. This is done by using the webservices. Refer Overview of Web Services to know more about web services.
After validating the user and checking whether the user is associated to a channel, the next step is to check if the user exists and is not authenticated in the channel. If yes, then proceed by sending the OTP to the mobile number. OTP is generated by using a Function (@fn.randomNumber) and storing the attribute in the context of the skill as shown below.
- Generate the One Time Password (OTP) and set it to a context attribute, for example, 'generatedOTP'. If the user is already authenticated in the channel, then user exits the skill. If the user is not authenticated, then proceed with sending the OTP.
- Create a skill for the guest user to register themselves in Luma. In this example, the skill name used is Select OTP action, and the associated attribute is selectotpaction.
- ‘selectotpaction’ is a list type attribute, which provides user with 3 options – ‘Enter OTP’, ‘Continue as Guest’ or ‘Resend OTP’.
- ‘selectotpaction’ also silently sends the random number using @fn.randomNumber function as a text message to the mobile number entered by the user.
- Add rules to ‘selectotpaction’ attribute to handle the 3 options - ‘Enter OTP’, ‘Continue as Guest’ and ‘Resend OTP’.
- On selecting the ‘Resend OTP’ option, the skill execution flow branches to the first skill in the flow (user registration skill, specified in step#1).
- On selecting ‘Continue as Guest’ option, the Welcome Skills are triggered.
- On selecting option ‘Enter OTP’, the skill branches to handle two cases – user enters correct OTP and user enters incorrect OTP. For correct OTP scenario, execute the system skill ‘Luma Channel Association’. For incorrect OTP, trigger the skill to authenticate the user in the Luma chat channel (IsUserAuthenticatedToChannel skill shown in step#2).
- On selecting the ‘Resend OTP’ option, the skill execution flow branches to the first skill in the flow (user registration skill, specified in step#1).
- Create a skill to handle the flow when user selects the 'Enter OTP' option. In this sample, the skill name used is Provide OTP.
- Create an attribute of number type and use it in the skill which handles the ‘Enter OTP’ option (in this example, the attribute name used is ‘provideotp’ as shown below).
- Use the attribute to create a skill. In this sample, the skill name used is Provide OTP as shown below.
- Add two rules to the new number type attribute to handle two scenarios – a) user enters correct OTP and b) user enter incorrect OTP.
If the entered OTP is incorrect, there are two options – have user go through the user registration process again or have a provision to resend the OTP as shown below.
Note
Send a message to the user that the entered OTP is invalid, before prompting to enter the OTP again.
Note
Send a message to the user that the entered OTP is invalid, before prompting to enter the OTP again.If the entered OTP is correct, user is associated to the channel by triggering the system skill ‘Luma Channel Association’ as shown below.
The user is now registered and associated to the respective chat channel. The welcome skills are displayed to the user, which are configured as part of the post fulfillment. The post fulfillment action can be created only for ‘Luma Channel Association' skill.
- Create an attribute of number type and use it in the skill which handles the ‘Enter OTP’ option (in this example, the attribute name used is ‘provideotp’ as shown below).
Registration Process in Action
This section discusses the user registration process in Luma through a user's chat process.
Scenario 1: User entered mobile number not available in Luma
When a new user interacts with Luma through any channel for the first time, it prompts users to register themselves. When the user triggers the user registration skill, Luma prompts user to enter their mobile number. If the entered mobile number is not associated to any contact, then the following error appears.
Scenario 2: User enters incorrect OTP
When a new user tries to register in Luma through a supported chat channel, an OTP is sent to their registered mobile number for verification. If the user enters wrong OTP, then another OTP is sent until user enters the correct OTP. Alternatively, user gets three options to choose from - Continue as Guest, Enter OTP and Resend OTP as shown below.
Scenario 3: User is authenticated through the OTP
When the user entered mobile number is valid and associated to a Luma contact, then an OTP is sent to the registered mobile number. When the user enters the correct OTP, the welcome skills are shown to the registered user as shown below.
Once the user registration is complete, you can send messages to your Bot user and receive responses from your Luma Virtual Agent. In case of any issues with the configuration, please contact the Serviceaide Support team.
Scenario 4: User is already authenticated in the channel
When a user is already authenticated in a channel, then the following message appears on entering the associated mobile number.
© 2019 Serviceaide 1-650-206-8988 http://www.serviceaide.com info@serviceaide.com