Operations
Authentication and identity
Sign-in with OmniCore.Identity or Microsoft Entra ID, and role claims.
OmniCore validates JWT bearer tokens issued by an identity provider. It stores no passwords itself: the token proves who the caller is, and OmniCore's own roles decide what they may do. Any OpenID Connect provider that issues JWTs will do; this page covers the two OmniCore is designed around.
| Provider | When |
|---|---|
| Microsoft Entra ID | Your organisation already uses it. |
| OmniCore.Identity | You need a standalone deployment with its own users. It mirrors Entra ID, so you can move later by changing configuration only. |
Entra ID
- Register an application for the database API, with app roles for the OmniCore roles you want to grant from
Entra (for example
SystemAdminandSales). - Register a public client for occtl and OmniCore Admin, and one for the portal and maker host, with the redirect URIs
they need (the host's is
https://<host>/signin-oidc). - Configure the database:
"OmniCore": {
"Auth": {
"Authority": "https://login.microsoftonline.com/<tenant-id>/v2.0",
"Audience": "<application (client) id of the API registration>",
"SubjectClaim": "oid",
"RoleClaim": "roles",
"BootstrapAdmins": [ "<object id of the first administrator>" ]
}
}With RoleClaim set, Entra app roles count as OmniCore roles: values match role names ignoring case, spaces and
punctuation, so SystemAdmin grants System Admin and FieldSales grants Field Sales. Unknown values are
ignored. You can also assign roles in OmniCore itself, matched on the oid claim.
OmniCore.Identity
OmniCore.Identity is a small identity provider that mirrors Entra ID's v2.0 endpoints and a subset of Microsoft Graph:
- a sign-in page (username and password);
- OpenID Connect and OAuth 2.0 endpoints issuing Entra-style JWTs, with app roles as claims;
- a Graph-shaped API for users, applications (with app roles and client secrets) and role assignments.
It supports the authorization code flow with PKCE (browsers and tools), the password grant, client credentials (for integrations) and refresh tokens.
Connecting the database
- Register the database as an API, with app roles:
POST /v1.0/applications
{
"displayName": "OmniCore Database",
"identifierUris": ["api://omnicore-db"],
"appRoles": [
{ "id": "<new guid>", "value": "SystemAdmin", "displayName": "System Admin", "allowedMemberTypes": ["User", "Application"], "isEnabled": true },
{ "id": "<new guid>", "value": "Sales", "displayName": "Sales", "allowedMemberTypes": ["User"], "isEnabled": true }
]
}- Configure the database:
"OmniCore": {
"Auth": {
"Authority": "http://localhost:5090/<tenantId>/v2.0",
"Audience": "<appId of OmniCore Database>",
"RoleClaim": "roles",
"ClientId": "<the CLI client's appId, from GET />",
"RequireHttpsMetadata": false
}
}RequireHttpsMetadata: false is only for a local http:// provider. Setting ClientId lets OmniCore Admin offer
browser sign-in.
- Assign roles to users (
POST /v1.0/users/{id}/appRoleAssignments) or integrations (POST /v1.0/servicePrincipals/{id}/appRoleAssignments).
OmniCore Admin recognises an OmniCore.Identity authority and adds a Users tab that does steps 1 and 3 for you. And occtl deploy sets all of this up when it deploys OmniCore.Identity, using its bootstrap settings to register the database API.
Built-in applications
| Application | Purpose |
|---|---|
OmniCore Identity Management (api://omnicore-identity) | The directory's own API, like Microsoft Graph. App roles Directory.Read.All and Directory.ReadWrite.All. |
| OmniCore Identity CLI | A public client for administrators, scripts and desktop tools, with the redirect URI http://localhost (any port). |
GET / on the identity server returns the tenant id, the issuer and both applications' ids.
OmniCore.Identity settings
Section Identity (environment variables Identity__Setting).
| Setting | Default | Description |
|---|---|---|
DataDirectory | identity-data | The folder for directory.json and signing-key.json. /data in Docker. |
TenantName | omnicore | A friendly tenant name accepted in URLs as well as the tenant id. |
PublicOrigin | The request's origin | The origin used in the issuer and the sign-in endpoints. Set it behind a proxy. |
AccessTokenLifetimeMinutes | 60 | Access and ID token lifetime. |
RefreshTokenLifetimeDays | 14 | Refresh token lifetime. |
AuthorizationCodeLifetimeSeconds | 300 | Authorization codes are single-use. |
ClientSecretLifetimeDays | 365 | For secrets created without an end date. |
PasswordIterations | 210000 | PBKDF2-SHA256 iterations for new password hashes. |
LockoutThreshold, LockoutMinutes | 5, 5 | Failed sign-ins in a row before a lockout, and how long it lasts. |
Bootstrap:UserName | admin@omnicore.local | The first administrator, created when the directory has no users and a password is given. |
Bootstrap:Password | — | Must meet the password policy. Supply it only for the first start. |
Bootstrap:Applications | [] | Applications to register at start-up if their AppId doesn't exist yet. |
Security
- Passwords are hashed with PBKDF2-SHA256 and a salt, and compared in constant time. The policy is 8–256 characters with at least three of lower case, upper case, digits and symbols.
- Repeated failures lock the account. Unknown usernames take the same time and give the same error as wrong passwords.
- Client secrets and refresh tokens are stored only as hashes.
- The sign-in page is protected against forgery, framing and script injection.
signing-key.jsonholds the private key that signs tokens. Keep the data folder private and backed up: losing it invalidates every token and secret, and anyone who can read it can sign tokens.- Run it behind HTTPS in production; it listens on plain HTTP, like most container workloads behind a TLS proxy.
Differences from Entra ID
One tenant per instance; no groups, consent prompts, conditional access or MFA; only /.default scopes; no device code,
implicit or on-behalf-of flows; and no signing key rollover (replacing the key invalidates all tokens). Error codes use
the prefix OMNI instead of AADSTS.
The portal and maker host
The browser never holds a token. The OmniCore.Portal host signs users in with OpenID Connect, keeps their tokens on the
server, gives the browser a session cookie, and adds the token to calls it forwards to the database. Each site (portal,
maker) needs its own registration at the identity provider, with the redirect URI https://<host>/signin-oidc.