Authentication & SSO
UIGraph supports built-in email and password authentication alongside organization-scoped single sign-on. An organization can configure multiple OpenID Connect (OIDC), OAuth 2.0, and SAML 2.0 identity providers.
SSO providers are configured at runtime under Settings > SSO. Their configuration is stored in the UIGraph database, not in provider-specific environment variables.
Supported methods
| Method | Status | Notes |
|---|---|---|
| Email and password | Active | Available as a fallback even when an organization has SSO providers. |
| OIDC / OAuth 2.0 | Active | Generic OIDC, Microsoft Entra ID, Okta, and selected OAuth providers. |
| SAML 2.0 | Active | SP-initiated login, SP metadata, signed assertion validation, and optional signed AuthnRequests. |
| LDAP | Not available | Configuration storage exists, but LDAP authentication is not implemented. |
| SCIM 2.0 | Not available | User and group provisioning endpoints are not implemented. |
UIGraph does not currently provide an enforced SSO-only mode. The password option remains available on the sign-in screen.
Forgotten passwords
A self-hosted installation has no self-service password reset. Selecting Forgot password? on the sign-in screen tells the user to contact their workspace admin, and no reset email is sent.
A server administrator sets a new password for the user instead. Send it to them over a channel you trust and ask them to change it after signing in.
Before configuring SSO
Prepare the following:
- An externally reachable HTTPS installation.
- A correct
UIGRAPH_PUBLIC_URL. UIGraph derives OIDC callback URLs and all SAML service-provider URLs from it. - A correct
UIGRAPH_FRONTEND_URLwhen the browser-facing frontend differs from the public API base URL. - An organization administrator account.
- A test user at the identity provider that will not lock the administrator out.
The API's general UIGRAPH_SECRET_KEY must already be configured. UIGraph uses that master key to encrypt OIDC client secrets and generated SAML SP private keys in the database. It is not an SSO-specific setting.
See SSO Security & Operations before enabling a provider for all users.
Organization-scoped providers
Every provider belongs to one organization and has a unique slug within that organization. The organization ID and provider slug are part of its public login URLs.
For an organization ID of <orgID> and a provider slug of <slug>:
| Purpose | URL |
|---|---|
| Start login | ${UIGRAPH_PUBLIC_URL}/api/v1/auth/orgs/<orgID>/login/<slug> |
| OIDC callback | ${UIGRAPH_PUBLIC_URL}/api/v1/auth/orgs/<orgID>/callback/<slug> |
| SAML ACS | ${UIGRAPH_PUBLIC_URL}/api/v1/auth/orgs/<orgID>/saml/<slug>/acs |
| SAML SP metadata | ${UIGRAPH_PUBLIC_URL}/api/v1/auth/orgs/<orgID>/saml/<slug>/metadata |
The provider detail screen displays the exact callback or SAML URLs to copy. Prefer those generated values over constructing URLs manually.
Provider slugs:
- Must contain 2 to 63 characters.
- May contain lowercase letters, digits, and single hyphens between words.
- Cannot be changed after provider creation.
Sign-in flow
The sign-in screen uses a three-stage flow:
- The user enters an email address.
- UIGraph finds organizations associated with the email's domain and existing organization memberships.
- The user selects an organization when more than one is available.
- UIGraph lists the enabled SSO providers for that organization.
- The user chooses a provider or selects password login.
Organization discovery is rate-limited to 20 attempts per email address in a 15-minute window.
An organization discovery domain and a provider's allowed-domain list serve different purposes:
- The organization domain makes the organization discoverable from the initial email screen.
- Allowed domains restrict which returned identity-provider email addresses may complete login through a particular provider.
See Provisioning, Domains & Roles for account creation and authorization behavior.
OIDC and OAuth 2.0
UIGraph uses the authorization-code flow:
- UIGraph creates a one-time login state with a 10-minute expiry and an OIDC nonce.
- The browser is redirected to the provider's authorization endpoint.
- The provider returns an authorization code and state to the organization-scoped callback URL.
- UIGraph consumes the state, exchanges the code, checks the ID-token nonce when an ID token is returned, and requests the UserInfo endpoint.
- UIGraph merges the returned claims and completes login using the configured email, name, subject, and groups claim names.
Supported provider types are:
| Type | Use for | Configuration |
|---|---|---|
entra | Microsoft Entra ID | Supply the tenant ID; UIGraph derives the endpoints. |
okta | Okta | Supply the Okta domain; UIGraph derives the endpoints. |
generic | OIDC and compatible OAuth providers | Supply authorization, token, and UserInfo endpoints. |
GitHub can be configured as a generic provider even though it is not OIDC. If GitHub's profile response hides the user's email, UIGraph requests the primary verified address from /user/emails. This requires the user:email scope.
See OIDC & OAuth Provider Examples for complete configurations.
UIGraph currently decodes ID-token claims and validates the nonce, but does not validate the ID-token signature, issuer, audience, expiry, or authorized-party claims. UserInfo claims overwrite claims with the same name, but role mappings can also reference other merged claims. Review the implications in SSO Security & Operations.
SAML 2.0
UIGraph acts as a SAML service provider and supports SP-initiated login:
- UIGraph creates a one-time login state and SAML request ID with a 10-minute expiry.
- The browser is redirected to the IdP using an HTTP-Redirect AuthnRequest.
- The IdP posts the SAML response to the provider's ACS URL.
- UIGraph validates the response signature, audience, time constraints, recipient, and request ID.
- UIGraph reads the email, name, NameID, and mapping attributes before completing login.
IdP-initiated login and SAML Single Logout are not supported. See Configure SAML 2.0 for setup and troubleshooting.
Account and role handling
OIDC and SAML use the same completion flow:
- The provider-returned email is normalized and checked against the provider's allowed domains.
- UIGraph finds an existing account by email.
- If no account exists, it is created only when Allow new users to sign up is enabled.
- Role mapping rules are evaluated from top to bottom; the first match wins.
- If no rule matches, the provider's default
admin,editor, orviewerrole is used. - Membership in the provider's organization is created or updated with
ssoas its source. - The provider subject or SAML NameID is stored as an identity link when available.
Role mappings are recalculated on every successful SSO login. They affect organization roles only; SSO mappings do not assign resource-specific permissions.
Sessions and logout
Both password and SSO login create a server-side session and an HttpOnly uigraph_session cookie:
- Sessions expire after 30 days.
- Cookies use
SameSite=Lax. - The
Secureflag is enabled whenUIGRAPH_PUBLIC_URLuses HTTPS. UIGRAPH_COOKIE_DOMAINcan scope the cookie across subdomains when required.
POST /api/v1/auth/logout deletes the current server-side session and clears the browser cookie. Logging out of UIGraph does not log the user out of the identity provider.
Current limitations
- Password login cannot be disabled per organization.
- Users cannot reset their own password. A server administrator has to do it for them.
- OIDC ID-token cryptographic and standard claim validation is incomplete.
- SAML login must be initiated from UIGraph.
- SAML Single Logout is unavailable.
- Organization discovery domains are not ownership-verified.
- LDAP authentication is unavailable.
- SCIM provisioning and deprovisioning are unavailable.
- Identity-provider deactivation does not immediately revoke an existing UIGraph session.
- UIGraph currently logs the complete set of attributes returned during SSO login.