OTP Access

Business Background

OTP (One-Time Password) access is a security mechanism that generates a unique, temporary password or code for a single login session or transaction. It is often used as an additional layer of authentication to enhance security, commonly in multi-factor authentication (MFA) systems. OTPs are valid for only a short period and can only be used once, making it difficult for attackers to reuse stolen credentials.

Titan Solution

With Titan, you can configure custom OTP access as a crucial security layer that helps safeguard sensitive information and transactions from unauthorized access and cyber threats.

How to Video

Coming soon!

How to Guide

In this article, you will learn how to do the following:

Note:

Prerequisites:

You must have Apex codes configured in Salesforce to do the following:

  1. Generate OTP: A method to generate a random OTP.
  2. Send OTP: A method to send the OTP via email, phone call or SMS.
  3. Validate OTP: A method to validate the entered OTP.
  1. Open the Titan Web project where you want to configure the custom OTP access.
  2. Click the Gear icon to open the Project settings.

Understand the Variables for OTP Access

You will need variables when you configure OTP Access. Here is a short description of how they are used in this instance:

  1. Select the Tools option and click the Custom Variables Gear icon. The Custom Variables screen opens.
Custom Variables Gear icon
  1. Create the Static variables as required. Here are some examples.
Custom Variables – Static
  1. Click the Conditions option.
  2. Click the Kebab icon and click the Edit option.
Custom Variables – Conditions
  1. Type “otp” in the field. The following variables are shown:
  • OTP IsLoggedIn: Use this variable for any condition or other criteria in Salesforce.
    • For instance, the variable is linked to the client who uses the OTP and everything they do from Titan in Salesforce during that session is done in the context of that specific Salesforce user (otherwise, all Salesforce actions are done in the context of the Integration User).
    • For instance, this can be used when mapping run criteria to ensure that a Salesforce Push only happens when the client is still logged in and the session is still valid.
Map Salesforce Fields
Map Salesforce Fields
  • OTP Time Until Session Ends: The default time is two hours, but it can be changed.

Configure the Apex Salesforce Integrations

Note:

These Apexes must be developed by your Salesforce developers.

  1. Click the Salesforce option. The Salesforce Integration screen opens.
Salesforce option
Salesforce option
  1. Click the Create New button to configure a new Salesforce Get integration.
Salesforce Integration screen
Salesforce Integration screen
  1. Use the Object in Salesforce drop-down list to select “Your APEX”.
  2. Type a description. This makes it easier to select the Apex later on.
  3. Add the Apex name in the Class Name field.
  4. Use the Trigger to execute pull drop-down list to select “User action”.
Map Salesforce fields - Object Settings
Map Salesforce fields – Object Settings
  1. Click the Parameters option and type the parameter/s in the relevant field. These are the parameters passed to the Apex.
Parameters
Parameters
  1. Click the Mapping option, and use the drop-down list/s to select the relevant option/s. These are the parameters passed from the Apex.
Mapping
Mapping
  1. Click the Apply button.
  2. Repeat these steps for the necessary Apex integrations.
  3. Click the Close button.
Salesforce Integration screen
Salesforce Integration screen

Configure the OTP Access

  1. Under User Access, ensure the OTP Access toggle switch is on.
  2. Click the Gear icon to open the Configure OTP screen.
OTP Access Gear icon
OTP Access Gear icon

Configure a session that is not shared

  1. Do not toggle the Use shared session switch.
  2. Use the drop-down lists to select the following:
    • Initial Action: This Apex will trigger and get the parameters when a client enters information on the form.
      • This information can be a last name, email and phone number, or any other information that you use to identify the user.
      • Titan passes these parameters as well as the method (for instance, SMS or email) that you chose to send the OTP to the Apex.
    • Send Action: This Apex is triggered if a login happens and the client is identified in the first step.
      • The client is shown the OTP verification screen where they can enter the one-time pin.
    • Verify Action: This Apex is used to verify the code that the client entered.
      • Titan sends the code to the Apex and the Apex validates whether the code is correct or not.
      • The client is logged in and Salesforce gives Titan the session for the client.
      • The session key is held by a Titan variable.
      • The session time can be set for when the client will be logged out.
Configure OTP screen
Configure OTP screen
Note:

You can open the Salesforce Integrations by clicking the Salesforce Integration button.

  1. Click the Next button.
  2. Use the toggle switches to enable the following:
  • Override Salesforce session: The OTP becomes the primary method of authorization, bypassing the previously issued Salesforce token.
  • Allow share session: Use the drop-down list to select the projects with which you want to share the session.
    • In this instance, the child project/s are selected.
Note:

This is useful if you have more than one Titan project that is connected.

  • For instance, you can have a parent and a child project.
  • The parent project redirects to the child project.
  • The OTP is configured on the parent project.
  • When the client is redirected from the parent project to the child project, the session as well as the remaining time is redirected to the child project.
  • Session Duration (minutes): Type a number in the field.
    • The session duration can range from 5 to 720 minutes.
    • When the toggle switch is off, the duration is 2 hours (120 minutes).
Configure OTP screen
Configure OTP screen
Note:

Configure environment variables if you are going to export the project/s. Refer to OTP Access with Environment Variables for more information.

Configure a shared session

You can configure a shared session from a child project to a parent project.

  1. On the child project, toggle the Use shared session switch.
  2. Use the Shared session source drop-down list to select the project with which the session is shared.
    • In this instance, the parent project is selected.
  3. Use the Parameters drop-down lists to select the template ID and the record ID, if necessary.
  4. Click the Next button.
Configure OTP screen
Configure OTP screen
  1. Click the Gear icon to configure the following:
    • Init Parameters
    • Login Parameters
    • Verify Parameters
Configure OTP screen
Configure OTP screen
Note:
  • The steps are the same. In this example, we will look at Init Parameters.
  • The options on the left of the screen come form the System Variables configured on this project. These are the variables that you want to get from the Apexes.
  1. Set the parameters:
    • Static: Type a parameter name in the field.
    • Field: Use the drop-down list to select an option.
  2. Click the Apply button.
On Init screen
On Init screen
  1. Click the Apply button.
Configure OTP screen
Configure OTP screen

The OTP verification is done on the parent project and passed to the child project.

Configure the Smart OTP Form Widget

  1. Click the + icon to open the list of elements.
  2. Select the Widget option from the list.
  3. Drag-and-drop the SmartV form to the canvas.
SmartV form widget
SmartV form widget
  1. Click the Gear icon and configure the SmartV OTP settings options as necessary.
  2. To configure the user access on a custom button, click the Hide button checkbox. The widget’s button will be hidden.
    • You can configure the following user access options on a custom button:
SmartV OTP Form Settings
SmartV OTP Form Settings
  1. Under Interactivity, click the Clear warning on re-enter checkbox to clear the warning that is shown when the incorrect OTP values are entered. The incorrect values are also cleared when the client starts to enter new values.
SmartV OTP Form Settings
SmartV OTP Form Settings

Configure the Access Control node – Login action

You can configure the action on a custom button to run the Initial and Login Apexes and redirect the client to the Smart OTP form widget.

  1. On a button element, click the On Click Action icon. The On Click Action screen opens.
On Click Action icon
On Click Action icon
  1. Next to the Start node, click the + icon. The Add Node screen opens.
On Click Action
On Click Action
  1. Under System Actions, click the User Action option and then click the Next button.
Add Node screen
Add Node screen
  1. Use the drop-down list and select the OTP Login user access parameters.
  2. Click the Next button.
Add Node/User Access screen
Add Node/User Access screen
  1. If necessary, change the tag and click the Insert button. The User Access node is added.
User Access node added
User Access node added
  1. Use the following options to add any actions on the User Access node as relevant:
    • During Run
    • On Fail Init
    • On Success
    • On Fail Login
    • On Success Login
    • On Fail Verify
    • On Success Verify
  2. Click the Apply button.

Configure the Access Control node – Custom Verify action

You can configure a verify action on a custom button to run the Verify Apex.

  1. On a button element, click the On Click Action icon.
On Click Action icon
On Click Action icon
  1. Next to the Start node, click the + icon.
On Click Action
On Click Action
  1. Under System Actions, click the User Action option and then click the Next button.
Add Node screen
Add Node screen
  1. Use the drop-down list and select the OTP Verify user access parameters.
  2. Click the Next button.
Add Node/User Access screen
Add Node/User Access screen
  1. If necessary, change the tag and click the Insert button. The User Access node is added.
User Access node added
User Access node added
  1. Use the following options to add any actions on the User Access node as relevant:
    • During Run
    • On Fail
    • On Success
  2. Click the Apply button.

Configure the Access Control node – Logout action

You can configure the action on a button to log out the client. The session ends when the client logs out.

  1. On a button element, click the On Click Action icon.
On Click Action icon
On Click Action icon
  1. Next to the Start node, click the + icon.
On Click Action
On Click Action
  1. Under System Actions, click the User Action option and then click the Next button.
Add Node screen
Add Node screen
  1. Use the drop-down list and select the OTP Logout user access parameters.
  2. Click the Next button.
Add Node/User Access screen
Add Node/User Access screen
  1. If necessary, change the tag and click the Insert button. The User Access node is added.
User Access node added
User Access node added
  1. Use the following option to add any actions on the User Access node as relevant:
    • During Run
  2. Click the Apply button.

Learn more about Titan’s native integration with the Salesforce Experience Cloud.

Create custom Salesforce forms, collect data, and automate processes with our drag-and-drop form builder.

Easily design, deploy, and measure custom web applications directly from Salesforce using Titan’s drag-and-drop web page builder.

Hidden Title

Need more help?