Enterprise
SSO answers who the person is at sign-in. Provisioning decides when their local account exists and when it changes. Choose just-in-time creation or directory-driven SCIM before connecting a provider, since that decision changes how onboarding and offboarding work.
Open Mercato's SSO module provides enterprise-grade Single Sign-On with OIDC and SCIM 2.0 support. This page covers architecture, configuration, and operational guidance.
| IdP | OIDC Login | SCIM Provisioning | JIT Provisioning | Notes |
|---|---|---|---|---|
| Microsoft Entra ID | Yes | Yes | Yes | Full OIDC + SCIM support. See Entra ID Setup Guide |
| Zitadel | Yes | Yes | Yes | OIDC + SCIM via Actions/native. See Zitadel Setup Guide |
| Google Workspace | Yes | No | Yes (recommended) | OIDC only, no SCIM push. See Google Workspace Setup Guide |
User -> Login Page -> HRD Check -> IdP Redirect -> IdP Login -> Callback -> Session
Two provisioning methods are supported, mutually exclusive per SSO config:
JIT (Just-In-Time) Provisioning
SCIM 2.0 Provisioning
JIT and SCIM cannot be enabled simultaneously on the same SSO config:
| Endpoint | Method | Description |
|---|---|---|
/api/sso/config | POST | Create SSO config |
/api/sso/config | GET | List SSO configs |
/api/sso/config/:id | GET | Get config by ID |
/api/sso/config/:id | PUT | Update config |
/api/sso/config/:id | DELETE | Delete config (must be inactive) |
/api/sso/config/:id/activate | POST | Activate/deactivate config |
/api/sso/config/:id/domains | POST | Add domain |
/api/sso/config/:id/domains | DELETE | Remove domain |
/api/sso/config/:id/test | POST | Test IdP connection |
/api/sso/hrd | POST | Home Realm Discovery lookup |
/api/sso/initiate | GET | Start SSO login flow |
/api/sso/callback/oidc | GET | OIDC callback |
/api/sso/scim/tokens | POST | Create SCIM token |
/api/sso/scim/tokens | GET | List SCIM tokens |
/api/sso/scim/tokens/:id | DELETE | Revoke SCIM token |
/api/sso/scim/v2/Users | POST | SCIM: Create user |
/api/sso/scim/v2/Users | GET | SCIM: List users |
/api/sso/scim/v2/Users/:id | GET | SCIM: Get user |
/api/sso/scim/v2/Users/:id | PATCH | SCIM: Update user |
/api/sso/scim/v2/Users/:id | DELETE | SCIM: Delete user |
| Control | Implementation |
|---|---|
| PKCE | S256 with 32-byte random code verifier |
| State Parameter | AES-256-GCM encrypted state cookie with HKDF key derivation |
| Nonce | 16-byte random nonce validated in ID token |
| State Comparison | Timing-safe (crypto.timingSafeEqual) |
| TTL | 5-minute state cookie lifetime |
| CSRF | SameSite=Lax cookies + encrypted state parameter |
| Return URL | Sanitized to prevent open redirects |
| Outbound Requests | Discovery and all provider endpoints reject private/reserved or mixed DNS answers, pin the validated address, disable redirects, and enforce time/size limits |
Public HTTPS identity providers work without additional configuration. For a private or on-premises
provider, an operator must explicitly list every trusted private endpoint origin in
OM_SSO_OIDC_PRIVATE_ORIGIN_ALLOWLIST (comma-separated exact HTTPS origins, including non-default
ports). Discovered JWKS, token, and user-info origins are validated independently; allowing the
issuer origin does not implicitly allow a different private origin.
| Control | Implementation |
|---|---|
| Token Format | omscim_ prefix + 32 random bytes (hex) |
| Storage | bcrypt-hashed (cost 10), only prefix stored |
| One-Time Display | Raw token returned only at creation |
| Timing Attack | Dummy bcrypt hash on zero candidates |
| Tenant Isolation | Organization ID derived from token, not request |
TenantDataEncryptionService)When JIT is enabled on an SSO config:
Warning · Limitations
When SCIM is configured:
Supported SCIM Operations:
POST /Users – Create userGET /Users – List users (with eq filter support)GET /Users/:id – Get userPATCH /Users/:id – Update user (replace operations on displayName, active, name.*, emails)DELETE /Users/:id – Delete user (soft-delete + deactivation)SSO configs support IdP group-to-application role mapping:
appRoleMappings on the SSO config (map IdP group names to app role names)Info · Google Workspace
Google does not send group claims by default. Role mapping is not available for Google OIDC without additional configuration.
| Variable | Required | Description |
|---|---|---|
SSO_STATE_SECRET | Yes (production) | 32+ byte secret for state cookie encryption |
APP_URL / NEXT_PUBLIC_APP_URL | Recommended | Base URL for redirect URI construction |
SSO_DEV_SEED | No | Set to true to seed demo SSO config in development |
OM_SSO_OIDC_PRIVATE_ORIGIN_ALLOWLIST | No | Comma-separated exact HTTPS origins allowed to resolve to private ranges for trusted on-prem IdPs |
provisioningMethod field on the user's SSO link record.Authorization: Bearer omscim_... header.An employee who signs in through the identity provider has passed the authentication test. Also change the assignment of a separate test user and inspect the result in Open Mercato. That second check shows whether your provisioning configuration matches the lifecycle you intend.