Skip to main content

Email & Password Authentication

Oxy’s built-in email and password authentication provides a self-contained authentication system with SMTP verification for user registration and password resets.

Features

  • ✅ No external dependencies
  • ✅ Email verification via SMTP
  • ✅ Works with or without load balancer
  • ✅ Ideal for development and small deployments
  • ✅ Password reset functionality
  • ✅ Secure password hashing (bcrypt)

Required Environment Variables

SMTP_USER=noreply@yourdomain.com
SMTP_PASSWORD=your_smtp_password
SMTP_SERVER=smtp.gmail.com  # Optional, defaults to Gmail
SMTP_PORT=587               # Optional, defaults to 587

Configuration

Using Gmail

  1. Create an App Password (recommended):
    • Go to your Google Account settings
    • Navigate to Security → 2-Step Verification → App passwords
    • Generate an app password for “Mail”
  2. Configure Environment Variables:
    SMTP_USER=your-email@gmail.com
    SMTP_PASSWORD=your_app_password
    SMTP_SERVER=smtp.gmail.com
    SMTP_PORT=587
    
  3. Start Oxy
    oxy serve
    

Using Custom SMTP Server

For custom SMTP servers (SendGrid, AWS SES, Mailgun, etc.):

SendGrid

SMTP_USER=apikey
SMTP_PASSWORD=your_sendgrid_api_key
SMTP_SERVER=smtp.sendgrid.net
SMTP_PORT=587

AWS SES

SMTP_USER=your_ses_smtp_username
SMTP_PASSWORD=your_ses_smtp_password
SMTP_SERVER=email-smtp.us-east-1.amazonaws.com
SMTP_PORT=587

Mailgun

SMTP_USER=postmaster@your-domain.mailgun.org
SMTP_PASSWORD=your_mailgun_password
SMTP_SERVER=smtp.mailgun.org
SMTP_PORT=587