smart-screen-lock-pin-auto-lock
Reactive icon

Smart Screen Lock (PIN & Auto-Lock)

Stable version 1.0.0 (Compatible with OutSystems 11)
Uploaded
 on 14 Nov (16 hours ago)
 by 
0.0
 (0 ratings)
smart-screen-lock-pin-auto-lock

Smart Screen Lock (PIN & Auto-Lock)

Documentation
1.0.0

📌 Overview

Smart Screen Lock (PIN & Auto-Lock) is a lightweight security component for OutSystems Reactive applications. It automatically locks the screen after user inactivity and requires the user to enter a PIN to unlock. The lock persists even after a browser refresh, ensuring sensitive information stays protected at all times.

This component is ideal for applications in HR, Finance, Healthcare, Admin Dashboards, and anywhere sensitive information is displayed.


🚀 Try Now

A live demo is available to test the component’s functionality.

🔗 Try Now: (Your Forge Try Now URL will appear automatically once uploaded)

Demo Credentials:


🛠 Installation & Setup

1. Install the Component

Download the component from Forge and add it to your OutSystems environment.

2. Drag the Block into Your Screen

From the Toolbox:
Interface → UI Flows → SmartScreenLock → Blocks → ScreenLockBlock
Drag it into the screen where you want to enable the lock.

3. Set Block Input Parameters

The block provides the following inputs:

ParameterTypeDescription
PINCodeTextThe PIN that the user must enter to unlock the screen. (Example: "1234" or "5698")
LockTimeoutIntegerThe number of minutes before the screen auto-locks due to inactivity. (Example: 1, 5, 10)

Example:

  • PINCode"1234"

  • LockTimeout1 (locks after 1 minute of inactivity)


⚙️ How It Works

🔒 Auto-Lock Behavior

  • A countdown timer begins on page load.

  • Any user activity (mouse movement, keyboard press, touch) resets the timer.

  • When inactivity exceeds the timeout, the screen locks and the PIN overlay appears.

🔁 Lock Persistence

  • If the user reloads the page while the lock is active, the screen remains locked.

  • The user must enter their PIN to unlock again.

🔓 Unlocking

  • User enters the PIN → if correct, screen unlocks.

  • Incorrect PIN resets the input box.


🎨 Styling

The component includes a modern overlay with fade-in/out animation.
You may override its CSS classes to customize colors, alignment, or input styling.

Key classes:

  • .lock-overlay

  • .lock-card

  • .pin-input


🧪 Testing Tips

  • Set LockTimeout = 1 during testing.

  • Refresh the browser → lock should remain active.

  • Test inside Chrome/Edge for accurate inactivity tracking.


🔐 Security Notes 

  • The PIN is not stored on the client.
    It is securely stored in your application’s database and passed only as a parameter to the block.

  • The component does not store or cache the PIN inside the browser.
    It is used only for the unlock comparison on the client side during the active session.

  • For increased security, you may optionally store a hashed version of the PIN in the database and compare using a server-side validation pattern, but this is not required for typical use cases.

  • No external APIs, cookies, or browser storage contain the PIN value.

  • The auto-lock mechanism is stored only as a session state (sessionStorage) to maintain the locked state during refresh — not the PIN.


📦 Included Artifacts

  • Reusable Block (Reactive)

  • Smart Screen Lock JS Engine

  • Overlay UI + CSS

  • Demo Module with login & example screen