Nama ERP DocsNama ERP Docs
Home
Namasoft.com
Data Model
GitHub
Home
Namasoft.com
Data Model
GitHub
  • Home

    • Search
    • Guides

      • بعض المعلومات عن استعمال هذا الموقع
      • Utility Links
      • System Minimum Requirements
      • Nama ERP Installation Guide
      • Jasper Reports Complete Guide for Nama ERP
      • Keyboard Shortcuts
      • Layout Names:
      • Entity Flows
      • دليل استخدام أداة إنشاء التقارير ونماذج الطباعة
      • الفواتير والضرائب والخصومات
      • Supply Chain
      • Tempo Language Manual
      • Sending Invoices and Documents to Customers
      • SMS and WhatsApp Configuration in Nama ERP
      • Two-Factor Authentication (2FA) Guide
      • Field Filter with Criteria
      • تعديل الترجمات في نظام نما
      • Criteria Based Validation
      • صيغ الحضور والانصراف
      • الربط مع ماكينات الحضور والانصراف
      • Nama ERP Notification System
      • Email By Parameterized Reports In Task Scheduler
      • Nama Properties
      • تطبيق الهواتف المحمولة
      • Mobile QR Integrator Guide
      • أعدادات الحقول و الشاشات - Generic Reference Overrider User Guide
      • ReportWizard User Documentation (أداة إنشاء تقرير)
      • ORACLE JDBC Integration Connection in context.xml for integration purposes
      • Nama ERP REST API
      • Criteria from Text Parser
      • ضوابط إنشاء طلبات تطوير من قبل أقسام الدعم الفني والتجهيز بالشركة
      • e-commerce integration (Magento)
      • .
    • Examples
    • Reprocessing Transactions
    • Frequently Asked Questions
    • AI Generated Entity Flows Documentation

      • Core
      • Accounting Module
      • AI Module
      • Contracting Module
      • CRM Module
      • EGTax Reader Module
      • Freight Management System Module
      • Hospital Management System Module
      • HR Module
      • e-commerce Integration Module
      • Manufacturing Module
      • POS Module
      • Real Estate Module
      • Service Center Module
      • Supply Chain Module
      • .
    • Release Notes

      • 2016
      • 2017
      • 2018
      • 2019
      • 2020
      • 2021
      • 2022
      • 2025
      • .
    • Video Tutorials

      • Supply Chain Videos
      • Report Wizard Videos
      • Human Resources Videos
      • .

Two-Factor Authentication (2FA) Guide

Overview

Two-Factor Authentication (2FA) adds an extra layer of security to the Nama ERP login process by requiring users to provide a second form of verification beyond their username and password. This feature supports multiple authentication methods and provides flexible configuration options for system administrators.

Supported Authentication Methods

1. Message OTP (One-Time Password)

Uses the configured notification template which can send OTP codes through multiple channels:

  • SMS: Send OTP codes via SMS to the user's registered mobile number
  • Email: Send OTP codes to the user's registered email address
  • WhatsApp: Send OTP codes via WhatsApp messaging
  • In-App Notifications: Display OTP within the application's notification system

2. Estidamah API Integration

Custom authentication provider integration for organizations using the Estidamah authentication gateway. This method:

  • Encrypts credentials using configured encryption keys
  • Sends encrypted data to the Estidamah authentication gateway
  • Gateway handles OTP delivery to users
  • Validates OTP through the integrated API

3. None

Disables 2FA (not recommended for production environments)

Configuration Settings

Access Login Settings

Navigate to: Global Configuration → Login Settings

Configuration Validation Rules

The system enforces the following validation rules when configuring 2FA:

  1. Message OTP Method Requirements:

    • Notification Template: You must select a notification definition for sending OTP codes
    • Error message if not configured: "Cannot select the option Message OTP without filling Notification For Two-Factor Authentication OTP"
  2. Estidamah API Method Requirements:

    • All three Estidamah fields are mandatory:
      • Environment URL
      • Encryption Key
      • Encryption IV
    • Custom Password Validator: Must be enabled in nama.properties
    • Error if not enabled: "You cannot enable Estidamah login method without enabling custom password validator in nama.properties first"

Available Configuration Fields in Global Config

FieldDescriptionDefaultOptionsValidation Rules
login2FAMethodSelect the 2FA authentication methodNone• None
• Message OTP
• Estidamah API
-
notificationFor2FAOtpNotification template for sending OTP-Select from available notification definitionsRequired when using Message OTP method
otpFormatFormat of the generated OTPNumeric• Numeric (e.g., 123456)
• Alphabetic (e.g., ABCDEF)
• AlphaNumeric (e.g., A1B2C3)
otpLengthNumber of characters in the OTP64-10 characters
otpExpiryTimeTime in seconds before OTP expires30060-1200 seconds (1-20 minutes)
otpResendDelayDelay in seconds before allowing OTP resend6030-300 seconds

Estidamah-Specific Settings

Only required when using Estidamah API method:

FieldDescription
estidamahEnvironmentUrlEstidamah gateway URL (Required)
estidamahEncryptionKeyEncryption key for securing credentials (Required)
estidamahEncryptionIVInitialization vector for encryption (Required)

Important Configuration Requirement

To use Estidamah API authentication method, you must enable custom password validator in nama.properties:

use-custom-password-validator=true

This setting prevents password hashing and allows the system to send encrypted credentials to the Estidamah gateway.

User Experience Flow

Standard Login with 2FA

  1. Initial Login

    • User enters username and password
    • System validates credentials
  2. OTP Generation

    • If 2FA is enabled, system generates OTP
    • OTP is sent via configured method (SMS/Email/Notification)
    • User sees OTP input screen
  3. OTP Verification

    • User enters received OTP code
    • System validates the OTP
    • Upon successful validation, user gains access
  4. OTP Resend

    • If user doesn't receive OTP, they can request resend
    • Resend is available after configured delay period
    • Same OTP is resent if still valid, new one generated if expired

Error Handling

  • Invalid OTP: User receives error message and can retry
  • Expired OTP: User must request new OTP
  • Maximum Attempts: After multiple failed attempts, account may be temporarily locked (configured separately)

User Settings

Excluding Users from 2FA

Individual users can be excluded from 2FA requirements:

  1. Navigate to User Management → User Settings
  2. Find the user account
  3. Enable "Exclude from 2FA" option
  4. Save changes

This is useful for:

  • Service accounts
  • Emergency access accounts
  • Users in specific roles that don't require 2FA

Technical Implementation Details

Session Management

  • OTP validation is tied to the login session
  • Once validated, OTP ID is cached temporarily
  • Subsequent API calls within the session don't require re-validation
  • Session timeout triggers new 2FA requirement

Notification Template Setup

Creating 2FA Notification Template

  1. Navigate to System Configuration → Notification Definitions
  2. Create new manual notification with:
    • Name: "2FA OTP Notification"
    • For Type: User
    • Manual: True (Selected)
    • Channel: Choose one or multiple:
      • SMS
      • Email
      • WhatsApp
      • In-App Notification
    • Template Variables:
      • {name1} - User's full Arabic name
      • {name2} - User's full English name
      • {otpCode} - Generated OTP code
      • Any field available in the user master file

Example SMS Template

Dear ${name2},
Your Nama ERP verification code is: {otpCode}
This code expires in 3 minutes.
Do not share this code with anyone.

Example Email Template

<p>Dear {name1},</p>
<p>Your Nama ERP login verification code is:</p>
<h2>{otpCode}</h2>
<p>This code will expire in 2 minutes.</p>
<p>If you didn't request this code, please contact your system administrator immediately.</p>

Example WhatsApp Template

🔐 *Nama ERP Security Code*

Hello {name2},

Your verification code is: *{otpCode}*

⏱️ Valid for 3 minutes only
⚠️ Do not share this code with anyone

If you didn't request this, contact IT immediately.

Compliance and Regulations

The 2FA implementation helps organizations meet various security compliance requirements:

  • ISO 27001: Information security management
  • PCI DSS: Payment card industry standards
  • GDPR: Data protection regulations
  • Local regulations: Saudi Arabia's NCA ECC requirements
Edit On github
Last Updated:: 9/9/25, 10:01 PM
Prev
SMS and WhatsApp Configuration in Nama ERP
Next
Field Filter with Criteria