Reference
Standalone Identity Server Reference
Reference tables for using SqlOS as a dedicated identity host for multiple applications.
This reference covers the advanced multi-application topology. Use Single-Application Setup if your product has one app.
| Concept | Meaning | Primary docs |
|---|---|---|
| Auth host | ASP.NET app that runs AddSqlOS and MapSqlOS | Getting Started |
| Client application | OAuth client representing one app surface | Clients |
| Audience | Resource/API identifier placed in access tokens | Token Validation |
| Application access | Policy for who may use a client application | Application Access |
| Headless auth | App-owned UI with SqlOS-owned protocol state | Headless Auth |
| Device flow | CLI/native flow without a redirect listener | CLI OAuth |
| Setting | Purpose | Example |
|---|---|---|
DashboardBasePath | Mounts dashboard and auth routes | /sqlos |
AuthServer.Issuer | Public issuer used in tokens and discovery | https://auth.example.com/sqlos/auth |
AuthServer.PublicOrigin | Public origin for generated links | https://auth.example.com |
AuthServer.DefaultAudience | Fallback API/resource audience | https://api.example.com |
builder.AddSqlOS<AppDbContext>(options =>
{
options.DashboardBasePath = "/sqlos";
options.AuthServer.Issuer = "https://auth.example.com/sqlos/auth";
options.AuthServer.PublicOrigin = "https://auth.example.com";
options.AuthServer.DefaultAudience = "https://api.example.com";
});| Method | Use for | Notes |
|---|---|---|
SeedBrowserClient | Browser SPA/web apps and custom-scheme callbacks | Public PKCE client |
SeedOwnedWebApp | First-party hosted web apps | Convenience wrapper for owned web clients |
SeedCliClient | Terminal apps | Enables device flow and refresh token |
| Dashboard-created client | Operators create or adjust clients after deploy | Not startup managed |
| CIMD | Portable public clients with HTTPS metadata client_id | See Client ID Metadata Documents |
| DCR | Compatibility public clients that expect runtime registration | See Dynamic Client Registration |
auth.SeedBrowserClient(
"customer-portal",
"Customer Portal",
"https://app.example.com/auth/callback");
auth.SeedBrowserClient(
"admin-console",
"Admin Console",
"https://admin.example.com/auth/callback");
auth.SeedBrowserClient(
"mobile-app",
"Mobile App",
"sqlos-mobile://auth-callback");
auth.SeedCliClient(
"support-cli",
"Support CLI",
"https://api.example.com",
"openid",
"profile",
"email",
"offline_access");| Mode | Behavior |
|---|---|
all_organizations | Any authenticated user with active organization context can use the app. |
selected_organizations | Only directly assigned organizations can use the app. |
selected_users_groups_roles | User, FGA user group, organization role, service account, or agent assignment required. |
internal_only | Explicit trusted assignment required. |
disabled | App cannot be used. Existing sessions fail refresh. |
Explicit denied assignments take precedence over allowed assignments.
principalType | Required fields | Typical use |
|---|---|---|
organization | organizationId or principalId | Enable one customer tenant for an app |
user | principalId | Allow or deny a named user |
group | principalId | Allow an FGA user group |
role | organizationId, roleKey | Allow tenant admins or members |
service_account | principalId | Allow a machine principal |
agent | principalId | Allow an agent principal |
| Endpoint | Purpose |
|---|---|
GET /sqlos/admin/auth/api/applications/{applicationId}/assignments | List assignments |
POST /sqlos/admin/auth/api/applications/{applicationId}/access-mode | Set access mode |
POST /sqlos/admin/auth/api/applications/{applicationId}/assignments | Create allow or deny assignment |
DELETE /sqlos/admin/auth/api/applications/{applicationId}/assignments/{assignmentId} | Revoke assignment |
GET /sqlos/admin/auth/api/applications/{applicationId}/access/check | Explain access decision |
GET /sqlos/admin/auth/api/organizations/{organizationId}/applications | Apps available to an organization |
GET /sqlos/admin/auth/api/users/{userId}/applications | Apps available to a user |
SqlOS checks application access when a concrete application and subject context are known:
Public errors use generic denial text. Audit events and the access-check endpoint carry the operator detail.
Resource APIs should validate the token independently:
app.UseSqlOSAccessTokenValidation(options =>
{
options.ExpectedAudience = "https://api.example.com";
});Application access decides whether a user may use an app. Audience validation decides whether an API should accept a token.
When UseHeadlessAuthPage is configured, SqlOS redirects to the app-owned UI with request state:
| Parameter | Meaning |
|---|---|
request | SqlOS authorization request ID |
view | Current view (login, signup, organization, mfa, device, etc.) |
email | Known email when already identified |
pendingToken | Token for intermediate auth state |
ui_context | Context for invitations, CLI, or specialized flows |
The app should call headless endpoints with the request ID instead of inventing separate login state.
Use standalone SqlOS when all of these are true:
Stay on single-application mode when those statements are not true.
Related: