AuthServer
AuthServer Overview
Identity, sessions, organizations, and SSO in one embedded module.
AuthServer is SqlOS's identity piece. Users, orgs, sessions, tokens, OIDC, and SAML run inside your app. Data lives in your database.
Multi-tenant orgs, memberships, and roles.
Email/password, email OTP, SSO-provisioned, or OIDC-linked identities.
JWT access tokens, refresh token rotation, and replay detection.
Optional self-enrollment, tenant-required TOTP, and recovery-code challenges.
Google, Microsoft, GitHub, Apple, and custom providers.
Enterprise SSO with provisioning and hosted flows.
Email-bound organization invites with hosted, headless, and SDK acceptance.
Device Authorization Grant for terminal apps and remote sessions.
Use the built-in pages or render your own UI on top of the same runtime.
builder.AddSqlOS<AppDbContext>();
var app = builder.Build();
app.MapSqlOS();Typical browser login:
/sqlos/auth/authorize with PKCE.For most teams, the first production flow should use a seeded or dashboard-created owned client. Add CIMD, DCR, and resource indicators only when you actually need portable or compatibility clients.

Open /sqlos/admin/auth/. Manage orgs, users, memberships, clients, OIDC, SSO, security, and sessions there.

| Service | Purpose |
|---|---|
SqlOSAuthService | Login, Email OTP, invitations, refresh, logout, token validation |
SqlOSAdminService | Create orgs, users, memberships, clients, SSO |
SqlOSCryptoService | Token generation, PKCE, password hashing, JWKS |
SqlOSHomeRealmDiscoveryService | Route users to password or SSO by email domain |
SqlOSSsoAuthorizationService | SAML SSO authorization and code exchange |
SqlOSOidcAuthService | Google, Microsoft, GitHub, Apple, and custom social login |
SqlOSSettingsService | Session lifetimes and security configuration |
SqlOS stores JWT signing keys in your application database. Private signing key PEMs are protected with SqlOSCryptoService.ProtectSecret when ASP.NET Data Protection is available, and legacy plaintext rows are upgraded the next time the active key is loaded.
Production deployments should configure a durable Data Protection key ring outside the application database. If Data Protection keys are lost, existing protected signing keys and other protected secrets cannot be unprotected.
SqlOS renders the login, signup, invitation, OTP, and recovery pages for you. This is the fastest path for internal tools and most first-party apps.
SqlOS still runs OAuth/OIDC, sessions, and token issuance. Your application takes ownership of the login UI and interaction flow.
Use seeded or dashboard-created owned clients for the normal path. Reach for CLI device flow, CIMD, and optional DCR when you need terminal, portable, or compatibility-oriented clients.
Headless Auth · Email OTP · MFA and TOTP · Email Invitations · CLI OAuth · Hosted vs Headless