OTP Generation
Overview
This module is designed to help you generate OTPs with full flexibility and customization โ perfect for applications that require secure user interactions.
โจ Designing a Flexible and Configurable OTP Solution
Built with Mendix and Java, this solution provides a robust OTP generation and validation mechanism, giving you complete control over security policies and user experience.
🔧 Key Features & How It Works:
-
Service-Level Configuration: Define security policies for each service, including:🔑 Maximum unverified attempts per OTP🔑 Maximum OTP generations per sessionโณ Automatic blocking after exceeding failed attempts🕒 Configurable OTP expiration time
-
Resend Functionality: Allow users to request OTP resends with a configurable limit on resend and generation attempts.
This module empowers Mendix developers to build secure, scalable, and customizable OTP workflows with ease.
Documentation
Mendix-OTPGeneration
This module to help you in generating OTP with full customization ๐๐ฒ๐๐ถ๐ด๐ป๐ถ๐ป๐ด ๐ฎ ๐๐น๐ฒ๐ ๐ถ๐ฏ๐น๐ฒ ๐ฎ๐ป๐ฑ ๐๐ผ๐ป๐ณ๐ถ๐ด๐๐ฟ๐ฎ๐ฏ๐น๐ฒ OTP
This solution implements a OTP generation and validation solution designed to enhance security for user interactions. The system is built using Mendix and Java and includes the following key functionalities:
Hereโs how it works:
โจ Designing a Flexible and Configurable OTP Solution
Built with Mendix and Java, this solution provides a robust OTP generation and validation mechanism, giving you complete control over security policies and user experience.
๐ง Key Features & How It Works:
-
Service-Level Configuration: Define security policies for each service, including:
-
๐ Maximum unverified attempts per OTP
-
๐ Maximum OTP generations per session
-
โณ Automatic blocking after exceeding failed attempts
-
๐ Configurable OTP expiration time
-
Resend Functionality: Allow users to request OTP resends with a configurable limit on resend and generation attempts.
Custom OTP Configurations: Services are linked to specific OTP configurations, which define:
๐ข Whether the OTP contains letters, numbers, or both.
ย
1- OTP Storage and Validation: OTP data is stored in the internal database. A unique session identifier is used to associate OTP with users. Validation ensures user-entered text matches the stored OTP.
2- Security Measures: OTP values are hashed before storage. Validation uses Mendixโs MendixHashString library for secure string comparison. Configurable maximum attempts before OTP expiration or refresh. Java Action: (verifyOTP)
ย
Purpose
This Java action validates the user-entered OTP string against the hashed value stored in the database. Key Logic
#Retrieve the stored OTP object using the session identifier and transaction ID.
#Use the MendixHashString.verifyValue method to securely compare the stored hash with the user input.
#Return true if the validation succeeds, false otherwise.
ย
Installation:
Download the Module Add the module to your project.
Assign Roles Map your project's user roles to the module roles provided: Administrator and User.
Access the Admin Page Open the OTPConfig_Overview page through your admin navigation or directly.
Run Your Application Youโre all set to get started! Configuration
Define OTPConfig Settings Configure general OTP settings, such as the length of the OTP, inclusion of letters, numbers, and other rules.
Adjust System or Service Rules Configure your systemโs behavior based on your use case by referring to the placeholders and documentation provided for each attribute. (Most attributes have detailed annotations to guide you.)
Generate OTP Refer to EX_OTP_User for an example of OTP generation. then you can use the OTP and send your sms , email , etc (This logic will be created by you)
Verify OTP Use either ACT_OTPVerification_Verify or ACT_OTP_Verify microflows. To customize: Duplicate the microflow in your own module. Read the annotations for guidance. Maintain the core verification logic, but you can tweak responses for failed or invalid inputs based on your specific requirements. Support
If you have any questions, feedback, or require assistance, feel free to reach out:
LinkedIn:(https://www.linkedin.com/in/mohamedelnady27/) Email: mohamed.k.elnady@gmail.com Enjoy and Happy Developing!