Skip to main content
Version: Next

Sessions, MFA & device trust

This module manages the security layer that protects user sessions after authentication. It covers active session tracking, multi-factor authentication enforcement, and device trust classification.


Foundation → Security (segment: foundation/security)

Sub-sectionPathDescription
Sessionsfoundation/security/sessionsActive session management
MFAfoundation/security/mfaMulti-factor authentication
Device Trustfoundation/security/devicesTrusted device management

Security architecture

┌─────────────────────────────────────────────────────────────────────────┐
│ Security Layer │
├─────────────────────────────────────────────────────────────────────────┤
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Authentication Flow │ │
│ │ │ │
│ │ Login → MFA Challenge → Device Check → Session Created │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────────────────┐ │
│ │ Sessions │ │ MFA │ │ Device Trust │ │
│ │ │ │ │ │ │ │
│ │ • Active │ │ • TOTP │ │ • Fingerprint │ │
│ │ • Suspended │ │ • SMS │ │ • Trust levels │ │
│ │ • Terminated │ │ • Email │ │ • Compromise detect │ │
│ │ • Expired │ │ • Backup │ │ • Auto-revoke │ │
│ │ • Revoked │ │ │ │ │ │
│ └──────────────┘ └──────────────┘ └──────────────────────────┘ │
│ │
│ ┌─────────────────────────────────────────────────────────────────┐ │
│ │ Login Attempt Tracking │ │
│ │ │ │
│ │ IP Address • Device Info • Location • Success/Failure │ │
│ │ │ │
│ └─────────────────────────────────────────────────────────────────┘ │
│ │
└─────────────────────────────────────────────────────────────────────────┘

Part 1: Sessions

Sessions track authenticated user access and allow administrators to monitor and control active logins.

Session properties

FieldTypeDescription
idstringSession identifier
userIdstringUser ID
tenantIdstringTenant ID
statusenumCurrent status
deviceTypeenumDevice category
deviceInfoobjectDevice details
ipAddressstringClient IP
userAgentstringBrowser/app info
locationobjectGeo-location
createdAtdatetimeSession start
expiresAtdatetimeExpiration time
lastActivityAtdatetimeLast activity
terminatedAtdatetimeEnd time
terminatedBystringWho ended session
terminationReasonstringWhy ended
isCurrentbooleanCurrent session
mfaVerifiedbooleanMFA completed

Session statuses

StatusDescription
activeSession is active and valid
suspendedTemporarily suspended
terminatedManually ended by user/admin
expiredAutomatically expired
revokedForce-revoked due to security

Device types

TypeDescription
desktopDesktop computer
mobileMobile phone
tabletTablet device
unknownCannot determine

Session management actions

ActionDescriptionUse case
View sessionsList active sessionsSecurity review
Terminate sessionEnd a single sessionLogout remote device
Terminate allEnd all sessionsSecurity incident
Suspend sessionPause sessionInvestigation
Resume sessionReactivate suspendedClear investigation

Bulk session operations

OperationDescription
terminateEnd multiple sessions
suspendSuspend multiple sessions
revokeSecurity revoke sessions
extendExtend session expiry

Session filters

FilterOptions
StatusActive, suspended, terminated, expired, revoked
DeviceDesktop, mobile, tablet
Date rangeFrom/to dates
UserSpecific user
IP addressSpecific IP or range

Viewing active sessions

  1. Navigate to Foundation → Security → Sessions
  2. View session list with:
    • User name and email
    • Device type and browser
    • IP address and location
    • Session start time
    • Last activity
  3. Filter by status, device type, or date
  4. Click session for details

Terminating sessions

Single session:

  1. Find session in list
  2. Click session row or ... menu
  3. Select Terminate
  4. Confirm termination

Multiple sessions:

  1. Select sessions via checkboxes
  2. Click Bulk Actions
  3. Select Terminate
  4. Confirm bulk termination

All sessions for user:

  1. Navigate to user profile
  2. Click Security tab
  3. Click Terminate All Sessions
  4. User must re-authenticate

Part 2: Login attempts

Login attempts track authentication events for security monitoring and account protection.

Login attempt properties

FieldTypeDescription
idstringAttempt identifier
userIdstringTarget user
emailstringLogin email used
ipAddressstringClient IP
userAgentstringBrowser info
deviceInfoobjectDevice details
locationobjectGeo-location
successfulbooleanSuccess/failure
failureReasonstringWhy it failed
mfaRequiredbooleanMFA was needed
mfaVerifiedbooleanMFA passed
createdAtdatetimeAttempt time

Failure reasons

ReasonDescription
invalid_credentialsWrong password
account_lockedToo many failures
account_disabledAccount deactivated
mfa_failedMFA verification failed
session_expiredToken expired
device_not_trustedDevice blocked

Account lockout

SettingDefaultDescription
Max attempts5Failures before lock
Lockout duration30 minHow long locked
Reset window15 minWindow for counting

When locked:

  • User sees "Account temporarily locked"
  • Admin can unlock in user profile
  • Auto-unlocks after duration

Part 3: Multi-factor authentication

MFA adds a second verification layer after password authentication.

MFA properties

FieldTypeDescription
idstringMFA config ID
userIdstringUser ID
methodTypeenumMFA method
statusenumMethod status
deviceNamestringDevice label
phoneNumberstringFor SMS method
emailstringFor email method
secretstringTOTP secret
lastUsedAtdatetimeLast verification
createdAtdatetimeSetup date

MFA method types

TypeDescriptionUse case
totpTime-based one-time passwordMost secure, recommended
smsSMS code to phoneConvenient, less secure
emailCode sent to emailFallback option
backup_codesOne-time recovery codesEmergency access

MFA device statuses

StatusDescription
pendingSetup not complete
activeReady for use
suspendedTemporarily disabled
revokedPermanently disabled

MFA setup flow

TOTP (Authenticator app):

1. User initiates MFA setup


2. System generates secret


3. Display QR code
┌─────────────┐
│ ▄▄▄ ▄ ▄ ▄▄▄ │
│ ▄ ▄ ▄▄▄ ▄ ▄ │ ← Scan with app
│ ▄▄▄ ▄ ▄ ▄▄▄ │
└─────────────┘


4. User scans with authenticator


5. User enters 6-digit code


6. System verifies code


7. MFA enabled ✓

SMS/Email:

1. User initiates setup


2. Enter phone/email


3. System sends code


4. User enters code


5. MFA enabled ✓

MFA setup response

FieldDescription
mfaIdConfiguration ID
methodMethod type
qrCodeQR code data URI (TOTP)
secretManual entry secret
backupCodesRecovery codes

Setting up TOTP

  1. Navigate to Profile → Security or Users → [User] → Security
  2. Click Enable MFA or Add Method
  3. Select Authenticator App
  4. Scan QR code with:
    • Google Authenticator
    • Microsoft Authenticator
    • Authy
    • 1Password
  5. Enter 6-digit code from app
  6. Save backup codes securely
  7. MFA is now active

Setting up SMS

  1. Navigate to Profile → Security
  2. Click Enable MFA
  3. Select SMS
  4. Enter phone number
  5. Click Send Code
  6. Enter received code
  7. MFA is now active

Backup codes

Backup codes are one-time recovery codes generated during MFA setup:

  • 10 codes generated by default
  • Each code can only be used once
  • Store securely offline
  • Regenerate if compromised

Using backup code:

  1. At MFA prompt, click Use backup code
  2. Enter one of your codes
  3. Code is consumed
  4. Check remaining codes

MFA verification flow

Login with password


MFA Required?──── No ────→ Session Created

Yes


Select Method


┌──────┴──────┐
│ │
TOTP SMS/Email
│ │
▼ ▼
Enter code Send code
from app to device
│ │
└──────┬──────┘


Verify Code


Session Created

Admin MFA management

Administrators can:

ActionDescription
View statusSee user's MFA methods
Reset MFARemove all MFA methods
Generate codesIssue new backup codes
Require MFAEnforce MFA for user

Part 4: Device trust

Device trust classifies devices based on security posture and allows restricting access to trusted devices only.

Trusted device properties

FieldTypeDescription
idstringDevice ID
userIdstringOwner user
tenantIdstringTenant ID
namestringDevice name
fingerprintobjectDevice fingerprint
trustLevelnumberTrust score (1-3)
statusenumDevice status
lastUsedAtdatetimeLast access
lastLocationobjectLast location
isPrimarybooleanPrimary device
compromisedbooleanFlagged as compromised
compromisedAtdatetimeWhen flagged
compromisedReasonstringWhy flagged

Trust levels

LevelNameDescription
1LowNew/unverified device
2MediumVerified but not fully trusted
3HighFully trusted device

Device fingerprint components

ComponentDescription
userAgentBrowser/OS string
screenResolutionScreen dimensions
timezoneDevice timezone
languageBrowser language
platformOS platform
hardwareConcurrencyCPU cores
deviceMemoryAvailable memory
touchSupportTouch capabilities

Device statuses

StatusDescription
activeDevice is active
suspendedTemporarily blocked
revokedPermanently removed

Device management actions

ActionDescription
View devicesList all trusted devices
Trust deviceAdd to trusted list
Revoke deviceRemove from trusted
Set trust levelChange trust score
Flag compromisedMark as compromised

Managing trusted devices

  1. Navigate to Profile → Security → Devices or Foundation → Security → Device Trust
  2. View list of devices:
    • Device name/type
    • Trust level badge
    • Last used time
    • Location
  3. Actions available:
    • Trust new device
    • Revoke device
    • Set as primary

Trusting a new device

When logging in from new device:

Login from new device


Device fingerprint captured


Trust check

┌────┴────┐
│ │
Known Unknown
device device
│ │
▼ ▼
Continue Prompt:
"Trust this device?"

┌───────┴───────┐
│ │
Yes No
│ │
▼ ▼
Add to list One-time
Trust = 1 access

Compromise detection

Devices can be flagged as compromised:

Automatic detection:

  • Login from unusual location
  • Multiple failed MFA attempts
  • Suspicious activity patterns

Manual flagging:

  • Admin marks device
  • User reports device lost/stolen

When compromised:

  • All sessions from device terminated
  • Device blocked from new logins
  • Alert sent to user and admins

Device trust policies

Organizations can enforce:

PolicyDescription
Require trusted deviceOnly allow trusted devices
Minimum trust levelRequire level 2+ for sensitive ops
Max devices per userLimit concurrent devices
Auto-revoke inactiveRemove unused devices

Security dashboard

The security module provides a dashboard view:

Overview metrics

MetricDescription
Active sessionsCurrent logged-in users
MFA adoption% users with MFA enabled
Failed loginsRecent failures (24h)
Locked accountsCurrently locked users
Trusted devicesTotal trusted devices
Compromised devicesFlagged devices

Recent activity

  • Recent login attempts
  • Session terminations
  • MFA changes
  • Device trust changes

Permissions required

ActionRequired permission
View own sessions(Self-service)
Terminate own session(Self-service)
View all sessionssessions.view
Terminate any sessionsessions.terminate
View own MFA(Self-service)
Manage own MFA(Self-service)
View user MFAmfa.view
Reset user MFAmfa.manage
View own devices(Self-service)
Manage own devices(Self-service)
View all devicesdevices.view
Manage devicesdevices.manage

Best practices

Session security

  • Set appropriate session timeouts
  • Enable idle timeout
  • Review active sessions regularly
  • Terminate sessions on role change

MFA enforcement

  • Require MFA for all admin accounts
  • Encourage TOTP over SMS
  • Store backup codes securely
  • Review MFA status quarterly

Device trust

  • Limit devices per user
  • Require re-verification periodically
  • Remove inactive devices
  • Respond to compromise alerts promptly

Troubleshooting

Session terminated unexpectedly

Causes:

  • Idle timeout reached
  • Admin terminated session
  • Security policy triggered
  • Token refresh failed

Fix:

  1. Re-authenticate
  2. Check security settings
  3. Contact admin if recurring

MFA code not working

Causes:

  • Clock out of sync (TOTP)
  • Code expired
  • Wrong method selected
  • Device time incorrect

Fix:

  1. Sync device time
  2. Wait for new code
  3. Try backup code
  4. Contact admin for reset

Device not recognized

Causes:

  • Browser updated
  • Cookies cleared
  • Incognito mode
  • VPN changed location

Fix:

  1. Trust device when prompted
  2. Don't use incognito for regular access
  3. Maintain consistent VPN usage

Cannot add MFA method

Causes:

  • Method already configured
  • Phone number invalid
  • Email not verified

Fix:

  1. Remove existing method first
  2. Verify phone format
  3. Verify email address