Overview
OIDC SSO protects the Dashboard and supports Authorization Code flow with PKCE, state and nonce validation, discovery, and signedHttpOnly,
SameSite=Lax sessions.
Unlike other Pro features, an explicitly enabled SSO configuration fails
closed: startup aborts when the sso entitlement is missing or the
configuration is invalid, so an authentication boundary cannot disappear
silently.
To sign in with SAML 2.0 instead, see SAML SSO. Everything on
this page except the OIDC client settings applies to both protocols: user
paths, group mapping, sessions, sign-out, and sign-in events.
Configure SSO
Configure it underextensions.sso in the main GoModel YAML configuration:
PRO_SSO_* environment variables override the YAML values. The redirect URL
must end in /sso/callback (including any configured BASE_PATH), and HTTPS
is required except for loopback development URLs. By default, at least one
administrator group or one group mapping is required; set
PRO_SSO_ALLOW_ALL_ADMINS=true only when the identity provider already limits
who can use the application (the OIDC client or the
SAML application) to the right people.
OIDC discovery does not block startup. If the identity provider is unreachable
when the gateway starts, the gateway starts anyway, existing sessions keep
working, new logins answer 503 with identity_provider_unavailable, and
discovery is retried in the background (5 seconds, doubling to 5 minutes). Set
require_discovery: true (PRO_SSO_REQUIRE_DISCOVERY=true) to make an
unreachable provider a startup error instead.
Identity and admission
Every accepted login gets a user path of its own and Dashboard access scoped to that path. The defaults place a person at/users/<lowercase email>.
The
user_path_claim value becomes one path segment, so a value that is
empty or contains / is refused.
Group mapping
group_mappings places the members of an identity-provider group under a
user path node. Budgets, rate limits, and model access set on that node then
cover every member, with no per-user setup:
PRO_SSO_GROUP_MAPPINGS carries the same list as a JSON array. When set, it
replaces the YAML list as a whole; the two are never merged, and [] clears
the list. A value that is not a JSON array stops startup.
How a login is mapped
- Matching is exact and case-sensitive.
groupis compared with the values ofgroups_claimas sent: nothing is trimmed, whether the claim is a list or a single string, and an empty string counts as no groups. Entra ID sends group object IDs, not names, so list the object IDs. - The first declared match wins. Order the list from most to least specific; a person always has exactly one user path.
- The path is
<user_path>/<user>.<user>is theuser_path_claimvalue, soalice@example.comineng-platformsigns in as/eng/platform/alice@example.com.user_path_prefixapplies only to logins that no mapping matched. - A mapping gives a per-user leaf, never the node itself. The user path
is also the access scope of the
session, so a person bound to
/eng/platformwould administer the whole team. Each member sees only their own usage, request log entries, and keys. - A login whose path would cover a node is refused. If the claim value
would make the path equal to a mapped node or to
user_path_prefix, or place it above one of them, sign-in fails withclaim_mapping_failed. For example, with nodes/engand/eng/platform, a member of the group mapped to/engwhose claim value isplatformis refused. - Paths configured elsewhere are not checked. That rule knows only the
nodes SSO configures (mapping user paths and
user_path_prefix), not the paths named by users policies, budgets, or rate limits. Auser_path_claimvalue that names such a path gives the session that path’s scope, including everything below it: apreferred_usernameofcontractorsunder/userswould sign that person in as/users/contractors, with the access scope of everyone below it. This applies to the defaultemailclaim too. Its value is always the person’s own verified address, so a path such as/users/alice@example.comis usually Alice’s own policy, which is intended. The risk is a path named after an email address that other users or keys sit under; do not place them there.
Who may sign in
allowed_domains, when set, is checked first.- When groups decide admission (
admin_groupsorgroup_mappingsis set), a login whose groups cannot be read is refused,allow_all_adminsincluded: a groups claim of the wrong type withclaim_mapping_failed, and groups the provider sent by reference instead of in the login withgroups_overage(see Limits). - A login that matches a mapping is accepted under that node.
- A login that matches none lands under
user_path_prefix, if it is admitted: withadmin_groupsset, the person must be in one of them (group_deniedotherwise, even withallow_all_admins); withoutadmin_groups, everyone is admitted whenallow_all_adminsistrue. - With neither
admin_groupsnorallow_all_adminsconfigured, an unmatched login is refused with the reasongroup_unmapped.
admin_groups, group_mappings, or
allow_all_admins: true. Use mappings alone to admit only mapped groups.
A login without a groups claim is a login in no group, not an error, because
many identity providers leave the claim out for a person in no group. Under
allow_all_admins without admin_groups, such a login therefore lands under
user_path_prefix, outside every mapped node and its limits unless
user_path_prefix itself lies inside a mapped node. Startup does not refuse
that overlap (for example a mapping to /teams with prefix /teams/guests);
such logins are then subject to the budgets, rate limits, and model access of
every node that contains user_path_prefix, while their access scope stays
their own leaf. If a person must
never get past the mappings, for example because a misconfigured provider
could drop the claim, do not enable allow_all_admins; admin_groups or
mappings alone refuse such a login.
Startup fails on an entry without a group or a user_path, a duplicate
group, an unknown key, a key repeated within an entry or spelled in another
case than group and user_path (in YAML and in PRO_SSO_GROUP_MAPPINGS
alike), or a user_path that is not absolute, is the root /, or has a .,
.., or : segment.
When the configuration changes
A session carries a fingerprint of the settings that decided its path:group_mappings (order included), user_path_prefix, user_path_claim and
whether its value is lower-cased (user_path_case_insensitive), and
groups_claim; with SAML, also the protocol and the SAML
attributes user_path_claim and groups_claim resolve to. Once the gateway
runs with any of them changed, every session issued before is refused and its
holder signs in again, so a mapping that is added, removed, or reordered
applies at once rather than at session expiry.
admin_groups, allow_all_admins, allowed_domains, session_ttl, and the
SAML settings trust_email and principal_attribute decide admission only
and leave existing sessions alone.
Independently, a session whose path is a mapped node, user_path_prefix, or
an ancestor of either is refused on every request, not only at sign-in.
Limits
- A changed group membership applies at the next login. The path is part
of the signed session, and GoModel does not ask the provider again while
the session lasts, so a move takes effect at most
session_ttllater (1 hour by default, 24 hours at most). A change to the mappings themselves applies at once; see When the configuration changes. - API keys stay on the old path. Keys a person created on their previous leaf keep working after they change group or leave. Deactivate them in the Dashboard.
- Entra ID leaves out the groups of people in too many groups. Above 200
groups in an OIDC token (JWT) and above 150 groups in a SAML assertion,
Entra ID sends a reference to Microsoft Graph instead of the groups: the
_claim_namesentry for the groups claim (OIDC) or thehttp://schemas.microsoft.com/claims/groups.linkattribute (SAML). GoModel does not fetch the groups from Graph and cannot tell which node the person belongs to, so whileadmin_groupsor mappings are set such a login is refused withgroups_overage. In Entra ID, emit only the groups assigned to the application in the groups claim. The limits then count those groups alone, so OIDC and SAML users alike, including SAML users in 151 to 200 groups overall, can sign in as long as no more than 200 (OIDC) or 150 (SAML) of their groups are assigned to the application.
Sign-out across replicas
Sign-out always ends the GoModel session first. To end the identity-provider session as well, setprovider_logout_url (PRO_SSO_PROVIDER_LOGOUT_URL) to
the provider’s absolute HTTPS logout URL; the gateway redirects there after
signing out. Configure the provider to return to /sso/logged-out below any
BASE_PATH: with BASE_PATH=/g, that is
https://gomodel.example.com/g/sso/logged-out. Without it, GoModel shows its
own signed-out page.
Signing out revokes the session immediately on the replica that handled it,
and records the revocation in the configured storage backend. Every replica
re-reads revocations every 2 seconds, so with PostgreSQL or MongoDB storage a
signed-out session stops working on all replicas within a couple of seconds.
Revocations survive restarts and are deleted once the session would have
expired anyway.
With SQLite, run a single replica: each SQLite instance has its own database,
so other replicas never see the revocation and a replayed cookie stays valid
there until it expires. If the storage backend is unreachable during sign-out,
the revocation still applies on the replica that handled it, a warning is
logged, and that replica keeps retrying until the other replicas can see it.
Sign-in events and access control
Successful logins, rejected policies, and logouts are recorded as sanitized authentication events in the request log. Tokens, authorization codes, cookies, raw claims, and provider error details are not stored.- Method. Login, rejection, and logout events record the protocol as
auth_method:oidcorsaml. Requests made with an SSO session, including/v1/auth/verify, are recorded assso. - Principal. A login refused after the identity provider’s answer was
verified (an admission refusal, and for SAML a refused subject or a
replayed assertion) is recorded under the principal it names and, when it is
known, the user path it would have had. A login refused because its path
would be a configured node is not recorded under that path, which is no
person’s; the log names it as
refused_path. - Logs. Each login is also logged under the same
request_id.GoModel Pro: SSO login succeedednames the group mapping that placed the login (matched_groupandnode), if any.
user_path like a managed API key does, so the
group- and user-level model allowlists on the Users page
apply to requests made through it. Per-key allowed_models are a managed
API key setting and do not apply to SSO sessions.
Rejected login reasons
A rejected login is recorded with one fixed reason, and the gateway logsGoModel Pro: SSO login rejected with the same reason and a request_id.
The person sees only a generic failure page with that ID as its reference.
Upgrade notes
These notes apply when you upgrade to the GoModel Pro release that introduces group mapping and SAML sign-in.Sessions issued by an earlier release carry no
configuration fingerprint. They stay
valid while no group mapping is configured, and are refused once one is, so
configuring the first mapping signs everyone out.