AuthServer
AuthServer Overview
Identity, sessions, organizations, and SSO in one embedded module.
AuthServer is SqlOS's identity piece. Users, orgs, sessions, OAuth tokens, social OIDC, and SAML run inside your app. Data lives in your database. For applications, SqlOS is an OAuth authorization server; for Google, Microsoft, Apple, and custom social login, it acts as an OIDC relying party.
Multi-tenant orgs, memberships, and roles.
Password, email code, magic link, phone code, 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.
Directory provisioning, deprovisioning, and FGA group sync.
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 and phone OTP, magic links, 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 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 authorization, sessions, token issuance, and its social OIDC relying-party flows. 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 · Magic Link · Phone OTP · MFA and TOTP · Email Invitations · SAML SSO · SCIM Directory Sync · CLI OAuth · Hosted vs Headless