Authentication
SMAF implements a secure authentication system to protect sensitive expense and travel allowance data for the Mexican Federal Public Administration.Login Process
The authentication workflow follows these steps:Access the Login Page
Navigate to the SMAF login page where you’ll see the INAPESCA branding and the application title: “Aplicativo de Control Interno de Viáticos (SMAF - WEB)”
Enter Your Credentials
Provide your username and password in the designated fields. All usernames are automatically converted to uppercase.
Both username and password fields are required and cannot be left empty.
Input Validation
The system validates your input before processing. SQL injection and malicious character patterns are blocked.
Credential Encryption
Your credentials are encrypted using Rijndael (AES) encryption before being sent to the server.
Index.aspx.cs
Authentication Verification
The system validates your encrypted credentials against the database through the
MngNegocioLogin.Acceso_Smaf() method.Session Establishment
Upon successful authentication, a 30-minute session is created with all your user information stored securely.
Index.aspx.cs
Security Features
Input Validation
SMAF employs regular expression validation to prevent SQL injection attacks and malicious input:Index.aspx.cs
- SQL commands (SELECT, DROP, INSERT, UPDATE, DELETE, etc.)
- Special characters that could be used in injection attacks
- Script tags and malicious code patterns
Encryption
All credentials are encrypted using Rijndael (AES) encryption before transmission and storage:MngEncriptacion.cs
The encryption keys are stored securely in the
MngEncriptacion class and use industry-standard AES encryption.Session Management
SMAF implements comprehensive session management to maintain security:Session Timeout
- Duration: 30 minutes of inactivity
- Locale: Set to LCID 2057 (UK English format)
- Version Tracking: Session includes application version for compatibility
Index.aspx.cs
Session Data
The following encrypted user information is stored in the session:Crip_Usuario- User identifierCrip_Password- Encrypted passwordCrip_Nivel- User levelCrip_Plaza- Position codeCrip_Puesto- Job titleCrip_Secretaria- Department/SecretariatCrip_Organismo- OrganizationCrip_Ubicacion- Location/Office assignmentCrip_Area- AreaCrip_Nombre- First nameCrip_ApPat- Paternal surnameCrip_ApMat- Maternal surnameCrip_RFC- Tax ID (RFC)Crip_Cargo- Position/RoleCrip_Email- Email addressCrip_Rol- Role identifier (determines menu access)Crip_Abreviatura- Abbreviation
Session Validation
Every page checks for session timeout before loading:Home.aspx.cs
IsSessionTimedOut() method verifies:
- Session exists
- Session is not a new session
- Session cookie is valid
Authentication Errors
Invalid Credentials
If authentication fails, you’ll see:Invalid Characters
Attempting to use forbidden characters triggers specific warnings:- Username: “Esta insertando un caracter o cadena invalida en el Usuario”
- Password: “Esta insertando un caracter o cadena invalida en el Password”
Session Expired
When your session expires after 30 minutes of inactivity, you’re automatically redirected to the login page.Best Practices
Use Strong Passwords
Choose passwords that combine letters, numbers, and special characters
Never Share Credentials
Your login credentials are personal and should never be shared with colleagues
Log Out When Done
Always log out when finishing your work, especially on shared computers
Report Suspicious Activity
Contact your system administrator if you notice any unusual account activity
Technical Reference
Authentication Flow
Source Code References
- Login Page:
Index.aspxandIndex.aspx.cs - Encryption:
MngEncriptacion.cs - Session Validation:
clsFuncionesGral.cs:42-70 - Authentication Logic:
Index.aspx.cs:65-111