Skip to main content

Overview

The Authentication module handles company registration and login for the Job Manager subsystem, providing secure access control with multiple authentication methods.

Company Registration

Registration Interface

Company registration form

Simplex Level (Basic)

The system provides a registration form with:
  • Required fields: Email, Password, Country
  • Optional fields: Phone Number, Street Name/Number, City
The system enforces unique email addresses - no two companies can share the same email in the database.
  • System sends activation email to new companies
  • Companies can only login after account activation
Country must be selected from a dropdown list, not entered as text.

Medium Level

Password must meet the following criteria:
  • At least 8 characters
  • At least 1 number
  • At least 1 special character ($#@!)
  • At least 1 capitalized letter
Email must meet standard formatting:
  • Contains exactly one ’@’ symbol
  • At least one ’.’ after the ’@’
  • Total length less than 255 characters
  • No spaces or prohibited characters (; : ( ))
If provided, phone number must:
  • Contain only digits
  • Start with valid international dial code (+84, +49, etc.)
  • Digits after dial code must be less than 13
  • Frontend: Quick user feedback
  • Backend: Security validation
  • Clear error messages displayed to users

Ultimo Level (Advanced)

Support registration via Single Sign-On from ONE platform:
  • Google
  • Microsoft
  • Facebook
  • GitHub
Can use personal email for this project.
  • System persists core company profile (name, email, country)
  • SSO users cannot use password for system access
  • Select user attribute as sharding key
  • Partition and store data in designated shard
  • Enhance search algorithm performance

Company Login

Login Interface

Company login form

Simplex Level

System authenticates using email and password:
  • No HTTPS: Use Basic Authentication format
  • With HTTPS: Send credentials in request body plaintext
Upon successful login:
  • Generate JSON Web Signature (JWS) token
  • Contains signed user identity data (ID, Role)
  • Verifies token integrity

Medium Level

Generate JSON Web Encryption (JWE) token instead of JWS:
  • Contains user identity (ID, Role)
  • Payload is encrypted
  • Cannot be read by unauthorized parties
  • Block authentication after 5 failed attempts
  • Within 60-second window
  • Prevents brute-force attacks
Invalidate and revoke JWE token when:
  • User explicitly logs out
  • Token reaches expiration time

Ultimo Level

Support login using account from selected external platform (same as registration).
  • Dedicated Redis cache for token revocation status
  • Quick check for non-SSO accounts
  • Improves security performance
For non-SSO accounts:
  • Short-lived Access Token
  • Longer-lived Refresh Token
  • Maintain session without frequent re-authentication

Implementation Guidelines

Security Best Practices

Never implement the following vulnerabilities:
  • Storing passwords in plaintext
  • SQL injection vulnerabilities
  • XSS vulnerabilities
  • Command injection
  • Insufficient token expiration

Validation Flow

Testing Requirements