3CX PBX in the Cloud
1 year FREE - no ties!
google cloud platform
3CX
Zero Admin
With the new Dashboard
3CX
Bulletproof Security
With SSL certs and NGINX
3CX
Install on $200 Appliance
Intel MiniPC architecture
3CX
New, Intuitive Windows Client
More themes, more UC
3CX
More CRM Integrations
Scripting Interface to add your own
3CX
Improved Integrated Web Conferencing
iOS and Android apps included
3CX
Run On-Premise or in the Cloud
Google, OVH, Windows & Linux
Fast & easy call management
With the 3CX Web Client

Using the Authentication component to validate customers

Using the Authentication component to validate customers

On this topic

Using the Authentication component to validate customers

Introduction

Step 1: Create the project

Step 2: Add the “Authentication” component

Step 3: Validate ID and PIN using a REST Web Service

Step 4: Check the validation result and inform it to the Authentication component

Step 5: Build and Deploy to 3CX Phone System

Introduction

Many times we need to authenticate callers, asking for an ID and PIN, and then validating them against different data sources. Usually we also need to iterate this procedure, and ask for the ID and PIN again in case of validation failure, until the validation succeeds or we reach a number of retry attempts. We have simplified this procedure to perform all these tasks in a single component. Now the 3CX Call Flow Designer includes the Authentication component for this!

In this article we’ll explain how to use the new Authentication” component to ask for an ID and PIN, and perform the validation using a web service. We’ll take this opportunity to also show how to use the new Web Service REST” component for the validation.

The project for this application is installed along with the 3CX Call Flow Designer, in folder “Documents\3CX Call Flow Designer Demos”.

Step 1: Create the project

First, we need to create a new project. Open the CFD and go to File > New > Project, select the folder where you want to save it, and enter a name for the project. In this case we’ll name it Authentication.

Step 2: Add the “Authentication” component

Now we’ll add the Authentication” component:

  1. Drag an Authentication” component from the toolbox, and drop it into the design surface of the “Main” callflow. Then select the component added, go to the Properties window and rename it to “authenticateCaller”.

  1. In order to open the configuration dialog for this component, double click or right click on it and select the menu option Configure. You will see the following dialog:

  1. Here we have basically 4 settings:
  • Max Retry Count for ID and PIN: this is the number of times the user will be able to retry entering the ID and PIN after a validation failure.
  • Request PIN: this check-box lets you define if the component should request only ID, or also a PIN.
  • User Input for ID: in this section we configure how we’ll be collecting the digits for the ID.
  • User Input for PIN: in this section we configure how we’ll be collecting the digits for the PIN.
  1. In this demo application, we’ll be asking for ID and PIN. We need to define the prompts to ask for ID and PIN, the prompts to inform that the input is invalid or that no digits were detected. We also need to set the minimum and maximum number of digits to collect for ID and PIN, the stop digit and the valid digits.

Step 3: Validate ID and PIN using a REST Web Service

The Authentication component has two branches: “Valid Input” and “Invalid Input”.

The “Valid Input” branch is executed when both the ID and PIN are successfully entered. This means that the user entered at least the minimum number of digits expected, but the validation has not been performed yet, so even if we’re executing the “Valid Input” branch, that doesn’t mean that the ID and PIN are valid.

The “Invalid Input” branch on the other hand is executed when the ID or the PIN were not entered by the user. In this case we might want to play a message for example to explain in more detail what the user needs to enter. In this case we’ll leave the “Invalid Input” branch empty, so when the user doesn’t enter a valid pair of ID and PIN, the component automatically retries asking for ID and PIN, until the Max Retry Count is met.

Finally, in the “Valid Input” branch we need to perform the validation. We will do this using the new Web Service REST component, which supports different authentication methods out of the box:

  1. Drag a Web Service REST component from the toolbox, and drop it into the “Valid Input” branch. Then select the component added, go to the Properties window and rename it to “validateCustomer”.

  1. In order to open the configuration dialog for this component, double click or right click on it and select the menu option Configure. You will see the following dialog:

  1. Here we need to configure our Web Service REST component, as follows:
  • URI: this is an expression that returns the web service endpoint. For example: "https://webservice.example.com/validation"
  • Request Type: the HTTP method used for the validation, in this case we’ll be using POST.
  • Content Type: this field describes what we have in the Content field. It could be JSON, XML, or any other content type we need, we can also specify a value which is not in the list, to do that we just type the value we want. For this demo we’ll be using “application/json”.
  • Content: this is an expression to build the actual content. In this demo we’re creating a JSON string like the following, using the CONCATENATE function:

{"id":"12345","pin":"67890"}

Our expression is:

CONCATENATE("{\"id\":\"",authenticateCaller.ID,"\",\"pin\":\"",authenticateCaller.PIN,"\"}")

Note that we’re using the variables “authenticateCaller.ID” and “authenticateCaller.PIN”, which hold the values entered by the user in the Authentication component.

  • Finally, we configure Basic Authentication and we set the user name and password from callflow variables.

Step 4: Check the validation result and inform it to the Authentication component

The Authentication component has a “Validated” property. We need to set it to true if the validation succeeds in order to stop the iterations. If we don’t do this, the Authentication component will ask for ID and PIN again when the “Valid Input” branch ends.

In order to do this, we can use a Create a Condition component. Add it from the toolbox and drop it below the Web Service REST component we added in the previous step. Rename it to “checkValidationResult”, configure the component with 2 branches and name them “validated” and “not_validated”. Set the Condition for the “validated” branch to the following expression to check if the web service returned the number “1” as validation result:

EQUAL(validateCustomer.ResponseContent,"1")

Then, in the “validated” branch set the variable “authenticateCaller.Validated” to true and transfer the call to the Support department extension, as the customer is validated.

On the other hand, in the “not_validated” branch we just play an error message, so the Authentication component can retry asking ID and PIN.

The “Valid Input” branch of the callflow should look like this:

Finally, after the Authentication component add another Transfer” component, but in this case transfer the call to sales. This Transfer component will be executed when the Authentication component has consumed all the retry attempts and the validation did not succeed.

Step 5: Build and Deploy to 3CX Phone System

The project is ready. We just need to build and upload it to our 3CX Phone System server. To do this:

  1. Go to Build > Build All. The CFD will create the file “Authentication.tcxvoiceapp”.
  2. Go to the 3CX Management Console > Call Queues, create a new queue, configure it with name and extension, check the Voice apps option, and upload the file created by the CFD in the previous step.
  3. Save the changes to the queue. The voice app is ready to use. Make a call to the configured extension to test this app.
Get 3CX Free for 1 Year Today
Download On-Premise Try in the Cloud