Configuring a Two Factor Authentication flow on Webex Connect

Learn how to setup a two-factor authentication communication flow using Webex Connect

📘

Usecase

• Business system invokes the Two factor authentication flow for a consumer number on IMIconnect
• The consumer gets the OTP which is valid for 15 mins
• The consumer submits the OTP to the Business system
• The Business system makes a API call to IMIconnect to validate the OTP
•IMIconnect sends the authorization status to the consumer

This tutorial is a walk through on setting up a two-factor authentication process using IMIconnect.

🚧

Prerequisites

• Access to IMIconnect platform (request your trial access here)
• Postman app ( or an alternative tool ) to invoke APIs (Download postman app from here)

Step 1 : Create a Service

You can get started with a Service on IMIconnect within seconds.

Click here for detailed steps on service creation

Step 2 : Get a Phone Number & assign it to the service

Pick a phone number and assign it to your service. If you are a new customer , you will have to buy a number.

For detailed steps on buying and assigning a number click here.

Step 3 : Create a Flow to Generate OTP

1. Create a New Flow

For detailed steps on creating a new flow click here

2. Select the custom event as the event trigger on the trigger category selection page

  • On the next window, configure your custom event. Select radio button "Create New Event"
  • Name the custom event. Next define the parameters to be used in this event.
  • Under the PARAMETERS (OPTIONAL) section, choose the TYPE as String from the drop
    down.
  • Enter msisdn as the variable.
  • Check the Mandatory box.
  • Click on +ADD NEW to define another parameter & define all the parameters as follows
TYPEVARIABLEMANDATORY
StringmsisdnYes
1120

3. Build the Flow

  • You will arrive at the Visual Flow Builder screen with the custom event node already present in
    the flow builder.
  • Drag and drop a Generate OTP node from the node palette to the left of the screen, under the
    Channels tab.
  • Connect the custom event node with the Generate OTP node by dragging the green dot
    towards the OTP node.
455
  • Double-click on the Generate OTP node to configure its parameters. You will arrive at the
    configuration window.

  • Choose the OTP format selecting from Alphabetic, Numeric, or Alphanumeric.

  • Choose the OTP length.

Note: Your OTP can be of 64 characters length which is the maximum limit. You can increase/decrease the OTP length by using the toggle buttons. Alternatively, you can enter the desired value manually.

  • Choose the OTP validity in minutes.

  • Choose Generate New OTP under ON RESEND OTP REQUEST

  • Enter any Transaction reference id in the Transaction reference field or alternatively use the input
    flow variables available. For eg : customEvent.timestamp

  • Place your cursor on TRANSACTION REFERENCE FIELD & select the variables available
    under Input Variables> Start > customEvent.timestamp

  • Click on SAVE to save these settings.

1515

4 Configure the 'onerror' event for Generate OTP node

Click here for detailed steps on configuring onerror event for a SMS/Generate OTP or any other node.

Step 4 : Configure Send SMS node

1. Add the Send SMS node**

  • Drag and drop the Send SMS node on to the flow canvas by dragging from the Channels
    menu under UTILITIES.

  • Connect the Generate OTP success event with the Send SMS node by dragging the green dot
    towards the Send SMS node

1247
  • Double-click on the Send node to open the configuration menu. You will arrive at the configuration
    window. See the image below.

  • Enter $(msisdn) in the Destination field.

Note: msisdn stands for Mobile Station ISDN number. It refers to the mapping of telephone number to SIM card.

  • Choose msisdn from the Destination Type drop-down.

  • Choose Text from the Message Type drop-down.

  • Choose the sender id assigned for the service from the senderid drop-down.

  • Enter the message to be sent to the customer in the Message box.

Note: In the figure below, the message contains $(n5.generateOTP.OTP). This will be replaced with the actual OTP when the SMS is triggered. This variable is available as the input variable.

  • Enter a name for the node in the Name field.

  • Click on SAVE at the bottom.

951

Step 5 : Create a Receive OTP trigger

  1. Create a Custom Event after going to the integrations screen
Click here to know more about creating a custom event.
  1. Setup the custom event by giving it a suitable name ( for eg : Two Factor Auth Receive OTP Trigger ) & configuring the following values
Variable NameTypeMandatory
OTPStringYes
  1. Click on SAVE to proceed further

Step 6 : Configure the Receive Response node

  1. Drag and drop the Receive node on to the flow canvas from the NODES menu under UTILITIES.
1461

2 Configure the Node Parameters

  • Double-click on the Receive node to open the configuration menu. You will arrive at the
    Configuration window. See the image below.

  • Select the "Receive Custom Event"

1120
  • Enter the maximum tolerant response time in the Maximum time out field.
  • Choose "Two Factor Auth Receive OTP Trigger " from the Custom event drop-down which has
    been created in STEP 5.
  • Enter a variable name in the RESUME_KEY field.

Note: The Resume_Key field is responsible to link the receive node's custom event with the custom event at the beginning of the flow to be able to fetch the OTP generated at the beginning of the flow.

  • Enter $(timestamp) in the VALUE field.
  • Enter a name for the node in the Name field.
  • Click on SAVE at the bottom.
945

3 Configure the onError event . To know more , click [here]

(https://help.imiconnect.io/v5.1/docs/configuring-error-events-for-a-node)
##4 Configure the onTimeOut event by dragging the Orange Dot onto Generate OTP node

Step 7 : Setup the Validate OTP node

1 Add the OTP Node

  • Drag and drop the OTP node onto the flow canvas from the NODES menu under UTILITIES.

2 Configure the Validate OTP Node Parameters

  • Double-click on the OTP node to open the Settings menu. See the image below.

  • Enter $(otp_used) in the OTP input variable field.

Note: The $(otp_used) is a variable in which the OTP entered for validation is stored.

  • Enter $(timestamp) in the Transaction reference field.
    (or)
    Place your cursor on TRANSACTION REFERENCE FIELD & select the variables available
    under Input Variables> Start > customEvent.timestamp

  • Enter a name for the node in the Name field.

  • Click on SAVE at the bottom

955

Step 8 : Configure Authentication success & Authentication failure actions

You can send the user an sms with the Authentication status message.

1 Configure the Authentication Success action.

  • Create the Send SMS node & configure it similarly as mentioned in Step 4 . Refer to the image below.
  • Provide the Authentication Successful message in the message box
1127
  • Link the onSuccess event of the previous node ( i.e Validate OTP) to Send SMS Auth successful node by dragging the green dot and dropping on to the SMS node.
  • Configure the onError & onPolicyFailure flows for the Send SMS event . For detailed steps , click here

2 Configure the Authentication Failure action.

  • Create the Send SMS node & configure it similarly as mentioned in Step 4 . Refer image below.
  • Provide the Authentication Failure message in the message box
1131
  • Link the onFailure event of the previous node ( i.e Validate OTP) to Send SMS Auth failure node
    by dragging the red dot and dropping on to the SMS node.
583

3 Configure the onError & onPolicyFailure flows for the Send SMS event . For detailed steps , click here

Step 9 : Publish the flow

  1. Click on MAKE LIVE at the top right corner of your screen to publish your flow.
  2. Click on the MAKE LIVE button at the bottom right to confirm.

Note: If you wish to add a comment, enter it in the Add an update comment section (optional).

Click here to know more about publishing a flow.

Step 10 : Invoke the flow using Postman

Click here for steps on testing using postman