How pujitha1307/adaptive-behavioral-authentication works
This is a Flask web app for continuous mouse-behavior authentication. The main workflow captures mouse telemetry in the browser, submits evaluation windows to Flask, extracts motion features, scores anomalies, and applies session-based risk thresholds to keep access normal or require OTP or credential re-authentication. Model training and threshold derivation form a separate supporting workflow. The graph also preserves the documented dashboard visualization and audit logging. Some route and template wiring is supported by README or excerpts; unsampled internals are not inferred.
Main entry points: app.py Flask routes and session · authenticate.py Anomaly scoring · mouse.js Mouse tracking and visualizer · train_model.py Baseline model training
Components 14
Browser experience
- Login screen
templates/login.html - Monitoring dashboard
templates/dashboard.html - Mouse tracking and visualizer
static/mouse.js
Session security
- Flask routes and session
app.py - Risk thresholds and lock states
app.py - OTP verification
app.py - Credential re-auth and audit
app.py
Behavior detection
- Session telemetry
app.py - Anomaly scoring
authenticate.py - Motion feature extraction
extract_features.py
Model training
- Baseline model training
train_model.py - Model and scaler
model - Derived thresholds and metrics
model/thresholds.json
Other components
- User
Connections 20
- User → Login screen: opens
README.md - Login screen → Flask routes and session: submits login
app.py - Flask routes and session → Monitoring dashboard: renders
app.py - User → Mouse tracking and visualizer: moves pointer
static/mouse.js - Mouse tracking and visualizer → Flask routes and session: posts windows
static/mouse.js - Flask routes and session → Session telemetry: records points
README.md - Flask routes and session → Anomaly scoring: requests score
app.py - Anomaly scoring → Motion feature extraction: extracts features
authenticate.py - Motion feature extraction → Anomaly scoring: returns features
authenticate.py - Anomaly scoring → Model and scaler: loads and scores
authenticate.py - Anomaly scoring → Derived thresholds and metrics: loads parameters
authenticate.py - Flask routes and session → Risk thresholds and lock states: applies thresholds
app.py - Risk thresholds and lock states → OTP verification: requires OTP
app.py - Risk thresholds and lock states → Credential re-auth and audit: requires re-auth
README.md - Mouse tracking and visualizer → OTP verification: submits OTP
static/mouse.js - Mouse tracking and visualizer → Credential re-auth and audit: submits credentials
static/mouse.js - Credential re-auth and audit → Flask routes and session: records reason
app.py - Baseline model training → Motion feature extraction: extracts raw features
train_model.py - Baseline model training → Model and scaler: saves artifacts
train_model.py - Baseline model training → Derived thresholds and metrics: writes thresholds
train_model.py