Skip to main content

Single sign-on

Users can sign in through any number of OpenID Connect or plain OAuth 2.0 identity providers. The platform uses the authorization code flow with PKCE (S256), accepts either client_secret_basic or client_secret_post token authentication, and reads the user from the provider's userinfo endpoint.

Set up a provider​

  1. Make sure platform.external_url is the public URL of the web UI. The chart sets it from ingress.host.

  2. Register a client at the identity provider with this redirect URI, where <name> is the provider name you will choose below:

    <external_url>/v1/auth/oidc/<name>/callback
  3. Add the provider to auth.providers on the Settings page, or through the API:

    curl -X PATCH https://idekube.example.org/v1/settings/auth \
    -H "Authorization: Bearer $TOKEN" -H 'Content-Type: application/json' \
    -d '{"providers": [{
    "name": "sso",
    "display_name": "Company SSO",
    "issuer": "https://sso.example.org",
    "client_id": "idekube",
    "client_secret": "..."
    }]}'

The provider appears as a button on the sign-in page. providers is one field: a patch replaces the whole list, so include the existing providers, with their masked secrets left as returned.

caution

Providers can also be set in the chart's settings.auth.providers, but the deployment settings file is a ConfigMap, so the client secret would be stored in clear text there. Prefer the Settings page or the API, which store it in the database.

Provider fields​

FieldDefaultMeaning
namerequiredIdentifier used in URLs: lower-case letters, digits and -, up to 32 characters.
display_name""Label of the sign-in button. Falls back to name.
client_id, client_secretrequiredClient credentials.
issuer""OIDC issuer. Its discovery document (/.well-known/openid-configuration) supplies any endpoint left empty below.
authorization_url, token_url, userinfo_url""Explicit endpoints. Set all three and leave issuer empty for a plain OAuth 2.0 provider.
scopes["openid", "profile", "email"]Requested scopes.
userinfo_path$JSONPath of the user document inside the userinfo response, for providers that wrap it.
subject_pathsubJSONPath of the stable user identifier. Falls back to the username when it yields nothing.
username_pathpreferred_usernameJSONPath of the username.
email_pathemailJSONPath of the email address.
display_name_pathnameJSONPath of the display name.
user_filter{}MongoDB-style query the user document must match for the sign-in to be accepted.
auto_createtrueCreate an account on a first sign-in. Off, only accounts that linked this provider themselves may sign in.
default_roles["user"]Roles of accounts created on a first sign-in.

subject_path, username_path, email_path, display_name_path and user_filter are evaluated against the document selected by userinfo_path.

Example for a provider that wraps the user in data and should only admit one organization:

{
"userinfo_path": "$.data",
"subject_path": "id",
"username_path": "account",
"user_filter": {"organization.id": "26000"}
}

How accounts are matched​

Accounts are kept apart by where they sign in. A local account signs in with its password; an account a provider made signs in through that provider alone, has no password, and shows its source (oidc:<provider>) on the Users page. An identity is never matched to an account by its name.

On every sign-in the platform looks up the pair (provider name, subject):

  1. Known identity: the account it is linked to signs in.
  2. Unknown identity: with auto_create, an account is made for it with default_roles, a personal team and no password, and linked; otherwise the sign-in is refused with oidc_no_account. The account takes the username the provider gives if it is free, or else that name after the provider (carol@sso), then numbered (carol@sso-2): a name taken here may be anyone's.

First sign-ins of one identity at once make one account. Someone signed in may also link a provider to their own account from their profile, which is the only way an identity reaches an account that exists. A disabled account is refused. To give people roles or a quota of their own, change their account after its first sign-in, or grant roles to everyone a provider makes with default_roles.

A failed sign-in returns the browser to the sign-in page with an error code: oidc_denied, oidc_state (the attempt took longer than 10 minutes), oidc_filtered, oidc_no_user, oidc_no_account, account_inactive or oidc_failed. The API server logs the cause.

Several providers can be configured at once; each gets its own button. A signed-in user can link further providers to the same account on their profile (Security tab): the platform sends them through the provider and attaches the returned identity instead of signing in. An identity already linked to another account is refused. A user may unlink a provider unless it is their only way to sign in.

Sign-ins through a provider skip the platform's two-step verification; the provider's own protection applies.

Enforcing single sign-on​

Turn auth.password_login off to remove password sign-in. Accounts that hold settings:write can still sign in with a password; see Users and roles.

Testing with Zitadel​

In a local cluster served over HTTPS (DEV_WS_DOMAIN and DEV_TLS_SECRET configured), make minikube.up and make minikube.zitadel run a development Zitadel instance at https://zitadel.<DEV_WS_DOMAIN>, seed a confidential OIDC Web application with project role assertions and test accounts, write the credentials to e2e/zitadel.json, and automatically register zitadel as an active provider in auth.providers (preserving any other configured providers) so Zitadel SSO appears on the sign-in page immediately. Run scripts/cluster/zitadel.sh register to re-register an existing seed file at any time, and run the Zitadel end-to-end suite against it with:

make e2e GROUP=auth TIER=extended-only SPECS=specs/oidc-zitadel.spec.ts

The suite exercises first-time provisioning, repeat sign-in, SSO session confirmation (prompt=login), local account linking and unlinking, auto_create: false, and user_filter matching on email and Zitadel project roles (urn:zitadel:iam:org:project:roles.<role>).