Magic Link Authentication
Magic link authentication lets users sign in by clicking a one-time link sent to their email address — no passwords required. Oxy delivers these links via Amazon SES and verifies them server-side.Only Amazon SES is supported as an email delivery provider at this time.
Support for additional providers (SMTP, SendGrid, etc.) is planned for a
future release.
How It Works
- User enters their email on the login page
- Oxy generates a cryptographically random 256-bit token and stores it with a 15-minute expiry
- An email containing a sign-in link is sent to the user via Amazon SES
- User clicks the link → token is verified and immediately invalidated → user is logged in
Features
- ✅ No passwords to manage or leak
- ✅ Tokens expire in 15 minutes and are single-use
- ✅ Works alongside Google OAuth and Okta OAuth
- ✅ Optional domain blocklist and email allowlist for access control
- ✅ IAM role credentials — no long-lived AWS keys required
- ✅ Local development mode (browser-based, no SES needed)
Prerequisites
- An AWS account with Amazon SES access
- A verified sender email address (or verified domain) in SES
- If your SES account is in the sandbox, recipient emails must also be verified
Environment Variables
| Variable | Required | Description |
|---|---|---|
MAGIC_LINK_FROM_EMAIL | Yes (production) | SES-verified sender address, e.g. noreply@yourcompany.com |
MAGIC_LINK_AWS_REGION | No | AWS region for SES (falls back to AWS_REGION) |
MAGIC_LINK_BLOCKED_DOMAINS | No | Comma-separated domains that are denied sign-in (e.g. gmail.com) |
MAGIC_LINK_ALLOWED_EMAILS | No | Comma-separated individual emails allowed to sign in |
MAGIC_LINK_LOCAL_TEST | No | Set to any value to enable browser-based local testing |
AWS_REGION | No | Default AWS region (used by SES if MAGIC_LINK_AWS_REGION not set) |
Setup Guide
1. Verify a Sender in Amazon SES
- Open the AWS SES Console
- Navigate to Verified identities → Create identity
- Choose Email address (or Domain for organization-wide use)
- Verify ownership via the confirmation email AWS sends
New SES accounts start in sandbox mode. In sandbox mode, you can only send
to verified email addresses. Request production access (“Move out of sandbox”)
when you’re ready to send to all users.
2. Configure AWS Credentials
Oxy uses the standard AWS credential chain. Preferred approaches (no long-lived keys): EC2 / ECS / Kubernetes with IAM Role (recommended): Attach an IAM role to your compute resource with this policy:3. Set the Sender Email
4. Start Oxy
Access Control
By default, any email address can request a magic link. Use the options below to restrict access: Domain blocklist — deny sign-in from specific domains (e.g. public email providers):When an email is denied, Oxy still returns a success response — it never
reveals whether a specific address is allowed. No email is sent.
Local Development
For local development you don’t need an AWS account. SetMAGIC_LINK_LOCAL_TEST to any value and Oxy will write the sign-in email to a temporary HTML file and open it automatically in your browser:
MAGIC_LINK_FROM_EMAIL is optional in local test mode. If omitted, Oxy uses
noreply@localhost as a placeholder sender.Combining with Other Auth Methods
Magic link works alongside Google OAuth and Okta. All enabled methods appear on the login page simultaneously:Security Details
| Property | Value |
|---|---|
| Token entropy | 256 bits (32 random bytes, hex-encoded) |
| Token lifetime | 15 minutes |
| Single-use | Yes — token is deleted immediately on first use |
| Email verification | Set automatically on successful sign-in |
| Access control disclosure | Never — always returns 200 to prevent enumeration |