Validate Certificate by QR Code
Endpoint
Authentication
This endpoint uses theisNotLoggedIn middleware - it is accessible to external users without authentication, allowing public validation of certificates via QR codes.
Path Parameters
Encrypted validation string from the QR code. This string is encrypted using ncrypt-js and contains the evaluation ID.
Validation Workflow
- QR Code Scan: User scans QR code on certificate
- URL Redirect: QR code contains URL with encrypted string
- Decryption: Server decrypts the string using ncrypt-js to extract evalID
- Data Retrieval: Certificate data is fetched from database
- Display: Validation view shows certificate details and authenticity
Response
Returns an HTML view (constanciaViews/constanciaValidatorView) with employee and certificate information.
Employee and certificate validation data.
Database Query
The validation query joins multiple tables to retrieve comprehensive certificate information:Encryption Details
Library: ncrypt-js Encryption Process:cadena parameter contains the evaluation ID, which is decrypted server-side using a secret key from the connection configuration.
Response Examples
Valid Certificate Displays validation view with:- Employee full name
- RFC and CURP identifiers
- Evaluation type
- Certificate issuance date
- Validation confirmation message
Error Handling
Error scenarios and responses.
Security Considerations
- The endpoint is intentionally public to allow certificate validation by third parties
- Encryption prevents tampering with evaluation IDs in URLs
- Only active certificates (constanciaActivo = 1) can be validated
- No sensitive data beyond basic employee identifiers is exposed
Integration Example
When generating a certificate, the QR code is created as follows:Use Cases
- Public Verification: External organizations scan QR codes to verify employee certificates
- Authenticity Check: Confirms certificate was issued by CEACC Durango
- Anti-Fraud: Prevents forged or altered certificates
- Audit Trail: Provides timestamp of certificate creation
Validation Status Indicators
The validation system provides visual indicators:
- Valid: Certificate found, active, and verified
- Invalid: Certificate not found or inactive
- Error: System error during validation
Related Endpoints
See also:- Generate Certificate - Create certificates with QR codes
- View Certificate - Display certificate before printing