Auth
Feature: Auth
Section titled “Feature: Auth”ɳSelf includes nHost Auth as a built-in service, providing a full authentication backend out of the box.
What’s Included
Section titled “What’s Included”| Capability | Description |
|---|---|
| JWT tokens | Short-lived access tokens + refresh tokens |
| OAuth 2.0 | GitHub, Google, Facebook, Apple, and more |
| Magic links | Passwordless email login |
| Email/password | Standard username/password auth |
| MFA | Time-based one-time passwords (TOTP) |
| User management | Roles, metadata, session management |
How to Enable
Section titled “How to Enable”Auth is a core service, it is always enabled. No plugin required.
Key Configuration Variables
Section titled “Key Configuration Variables”| Variable | Description | Default |
|---|---|---|
AUTH_JWT_SECRET | JWT signing secret | Auto-generated |
AUTH_CLIENT_URL | Allowed redirect URL after login | Required |
AUTH_SERVER_URL | Auth service public URL | Derived from BASE_DOMAIN |
AUTH_RATE_LIMIT | Auth endpoint rate limit | 30r/m |
AUTH_SMTP_HOST | SMTP host for magic link emails | Optional |
OAuth Provider Setup
Section titled “OAuth Provider Setup”To enable OAuth providers, set the relevant env vars:
AUTH_PROVIDER_GITHUB_ENABLED=trueAUTH_PROVIDER_GITHUB_CLIENT_ID=your-client-idAUTH_PROVIDER_GITHUB_CLIENT_SECRET=your-secretSee Also
Section titled “See Also”- Config-Auth: full auth configuration reference
- cmd-service: enable/disable auth
- Feature-Plugins: extend auth with the pro auth plugin