Example applications
Choose a runnable .NET, browser, mobile, or CLI reference implementation for SqlOS.
Razor Pages, built-in OAuth middleware, PKCE, encrypted cookies, a protected API call, and revoking logout.
Notes uses UseSingleApplication, hosted sign-in, a protected API, and tools sharing one authorization service.
ConfigureApplication with Razor Pages, CLI, and broker clients, hosted login, and FGA-filtered data.
Two APIs and ASP.NET Core, Next.js, and Angular clients orchestrated with .NET Aspire.
A .NET CLI using Device Authorization Grant, token polling, refresh, and protected Todo commands.
SqlOS as an OpenID Provider: a Next.js + Auth.js relying party federates through OIDC discovery, consent, and remembered grants.
The Notes sample is the complete UseSingleApplication example. Supply a SQL Server or PostgreSQL connection as described in its README, then run:
dotnet run --project examples/SqlOS.OneCall.ApiOpen http://localhost:5085, sign in through AuthPage, and add a note. Connect an MCP client to /mcp to access the same notebook. Api, Mcp, Brand, and Authorization describe the host; its API and tools call the same FGA-enforcing service. The walkthrough includes another user's isolation, revocation, restoration, and logout.
Run one command from the repository root:
dotnet run --project examples/SqlOS.Todo.AppHost/SqlOS.Todo.AppHost.csprojThis starts a persistent PostgreSQL container, the Todo API and embedded SqlOS host at http://localhost:5080, and the Razor Pages client at http://localhost:5090. Set SqlOS:DatabaseProvider=SqlServer to start SQL Server instead. Aspire reports resource health at its authenticated https://localhost:18890 dashboard.

The browser journey is deliberately ordinary ASP.NET Core:
/signin-sqlos callback, code exchange, ID token validation, and UserInfo claims;/api/me and creates its encrypted cookie;Read the ASP.NET Core sample guide on GitHub for the source tour, security decisions, and troubleshooting.
The full stack adds the broader example API, Next.js, and Angular:
npm ci --prefix packages/headless && npm run build --prefix packages/headless
npm ci --prefix examples/SqlOS.Example.Web
npm ci --prefix examples/SqlOS.Example.AngularWeb
dotnet run --project examples/SqlOS.Example.AppHost/SqlOS.Example.AppHost.csprojUse it to compare a server-rendered .NET client with hosted and headless browser flows, optional social/OTP providers, multi-client registration, retail resource hierarchies, and identity-dependent EF results.
For the source-guided browser implementation, follow Build your own login and signup UI, then compare its focused flow with the complete Next.js and Angular clients below.

The AppHost starts these user-facing surfaces:
| Surface | Local URL | What to inspect |
|---|---|---|
| ASP.NET Core | http://localhost:5090 | Native middleware, cookie session, protected Todo identity |
| Next.js | http://localhost:3010 | Hosted/headless choice, account and MFA, retail/FGA UI |
| Angular | http://localhost:4200 | angular-oauth2-oidc hosted login and the same retail authorization model |
| Example API | http://localhost:5062/swagger | Application-owned API contract |
| SqlOS dashboard | http://localhost:5062/sqlos | Identity, clients, sessions, providers, and FGA administration |
| Todo API | http://localhost:5080 | Focused hosted-auth and authorization sample |
The authenticated Aspire dashboard URL is printed at startup; its configured listener is https://localhost:18888.
| Host | API | Clients |
|---|---|---|
| Notes | UseSingleApplication with Api, Mcp, Brand, Authorization | One derived first-party client for a browser, native, or agent front end; portable MCP clients connect to the protected resource |
| Retail | ConfigureApplication with Brand, Headless, Authorization | Explicit Next.js, Angular, and Expo clients |
| Todo | ConfigureApplication with Brand, optional Headless, Authorization | Explicit hosted-demo, Razor Pages, CLI, and broker clients |
| App X | ConfigureApplication with Brand | Explicit App Y relying party; dedicated OIDC provider |
Retail retains its public demo/auth routes and additional demo credential types. Todo retains its configurable resource audience and per-operation scope checks. Notes demonstrates derived bearer-only API/MCP protection. The browser and native clients continue using their standard OIDC libraries with hosted AuthPage or @sqlos/headless.
| Project | Runtime status | Best source material |
|---|---|---|
SqlOS.OneCall.Api | Standalone Notes host; real SQL Server/PostgreSQL browser/API/MCP integration coverage | README and source |
SqlOS.Example.AspNetCoreWeb | Launched by both AppHosts; implements login, refresh, protected API, and revoking logout | README and source |
SqlOS.Todo.Api | Canonical focused API; real-SQL integration coverage | README and source |
SqlOS.Example.Api | Broad embedded platform example; real-SQL integration coverage | README and source |
SqlOS.Example.Web | AppHost-launched Next.js client; production build checked | README and source |
SqlOS.Example.AngularWeb | AppHost-launched Angular client; production build checked | README and source |
SqlOS.Todo.Cli | Separately launched .NET client; the Todo Web + CLI E2E (PostgreSQL) job runs the built executable through login (browser approve and deny), whoami, add, list, and logout | README and source |
SqlOS.Example.ExpoApp | Separately launched reference client; TypeScript-checked, but not an AppHost or end-to-end browser-test target | README and source |
SqlOS.Example.Tests | Fast tests for ASP.NET Core refresh, ticket renewal, and logout fallback | Test source |
The root example catalog documents every project, port, provider setting, persistence rule, and test command.
ITicketStore.Those boundaries are part of the reference implementation. They tell you which code is a trustworthy integration contract and which choices you still need to make for your own deployment.
dotnet build SqlOS.sln
dotnet test examples/SqlOS.Example.Tests/SqlOS.Example.Tests.csproj
dotnet test examples/SqlOS.Todo.IntegrationTests/SqlOS.Todo.IntegrationTests.csproj
dotnet test examples/SqlOS.Example.IntegrationTests/SqlOS.Example.IntegrationTests.csprojContinue with production readiness before adapting a local callback, cookie, secret, key ring, or persistent sample database to a deployed environment.