Security Configuration

Security Settings

Configure account lockout, bot protection, sign-up modes, and email restrictions to protect your application.

Overview

AuthCore provides enterprise-grade security features that can be configured per-tenant. All security settings are stored in the database and can be managed through the SecuritySettings component or API.

🔒 Account Lockout

Protect against brute force attacks by locking accounts after failed attempts

🤖 Bot Protection

Block automated attacks and suspicious registration patterns

📧 Email Restrictions

Control who can sign up with allowlists, blocklists, and domain restrictions

🎫 Sign-up Modes

Control registration flow: Public, Restricted, or Waitlist-only

Account Lockout Configuration

Prevent brute force attacks by locking accounts after too many failed login attempts.

Database Configuration

Database Schema

Setting via API

API Call Example

Using SecuritySettings Component

pages/admin/security.tsx

How It Works:

  1. Failed login attempts are tracked in the database
  2. After maxLoginAttempts failures, account is locked
  3. User receives 423 (Locked) response with lockout duration
  4. After lockoutDuration minutes, account auto-unlocks
  5. Set lockoutDuration: null for permanent lockout (admin must unlock)

Bot Protection

Enable bot protection to block automated attacks, suspicious patterns, and disposable email addresses.

Enable Bot Protection

Enable Bot Protection

Bot Protection Features:

  • ✓ Blocks disposable email providers (tempmail, guerrillamail, etc.)
  • ✓ Detects suspicious registration patterns
  • ✓ Rate limiting on auth endpoints
  • ✓ Optional: Block email subaddresses (plus addressing)
  • ✓ CAPTCHA integration (configure separately)

Sign-up Modes

Control how users can register for your application.

Available Modes

P

PUBLIC Mode (Default)

Anyone can sign up freely. Best for consumer apps and SaaS products.

R

RESTRICTED Mode

Users must be invited or manually created by admins. Best for internal tools and B2B apps.

W

WAITLIST Mode

Users must join waitlist and be approved before signing up. Best for beta launches and exclusive access.

Setting Sign-up Mode

Waitlist Mode Example

Waitlist Implementation

Email Restrictions

Control who can sign up using email domain allowlists, blocklists, and specific email addresses.

Using EmailListManager Component

Email Restrictions UI

Programmatic Configuration

Email Restrictions Configuration

Complete Configuration Example

High-Security SaaS Application

High-Security Configuration

Consumer SaaS with Beta Launch

Beta Launch Configuration

Open Consumer Product

Open Product Configuration

Environment Configuration

Some security settings can also be configured globally via environment variables.

.env

Note

Environment variables set global defaults. Per-tenant database settings take precedence and allow fine-grained control per organization.

Monitoring & Audit Logs

All security events are automatically logged for auditing and monitoring.

Monitoring Security Events

Best Practices

✓ Start Secure, Loosen Later

Begin with restrictive settings (RESTRICTED mode, strict lockout) and relax them based on user feedback and abuse patterns.

✓ Monitor Lockout Events

If you see many legitimate users getting locked out, consider increasing maxLoginAttempts or reducing lockoutDuration.

✓ Use Waitlist for Beta Launches

Waitlist mode creates urgency and allows you to control growth. Great for beta launches and building hype.

✓ Enable Bot Protection

Always enable bot protection in production. It blocks most automated attacks with minimal impact on real users.

✗ Don't Make Lockout Too Strict

A maxLoginAttempts of 2-3 may frustrate users. Start with 5 and adjust based on data.

✗ Don't Use Permanent Lockouts Lightly

Setting lockoutDuration: null means users can't unlock themselves. Only use for high-security scenarios with admin support.

Next Steps