Cross-realm memberships

A membership is a tenant-local grant allowing an existing principal in the main Ipseity realm to sign into that tenant's applications. It keeps one password, MFA configuration and profile in the home realm while assigning independent roles and groups in each customer realm. Customer-local accounts continue to work without memberships.

For example, adrian in ipseity can administer Delount Art Glass through a membership in websites-delountartglass. Another customer's realm needs its own membership. Global administration (ipseity.super) neither creates a membership nor supplies application permissions.

Object schema

Memberships are entities named memberships (singular payload kind membership), stored in the tenant's namespace, alongside its clients, roles and groups.

Field Required Meaning
name Yes Stable membership identifier; lowercase DNS-style name, at most 63 characters. Keep this stable because it forms the application's subject identifier.
entity No membership; the REST API supplies it automatically. Include it in GitOps payloads.
identity_realm Yes Home realm containing the actual principal. Currently must equal IPSEITY_NAMESPACE (default ipseity).
identity_subject Yes Existing principal's exact stored name, e.g. adrian. It is neither an email nor a display name.
roles No Tenant-local direct role names; default [].
groups No Tenant-local group names; default []. Group roles and permissions are resolved locally.
disabled No Boolean; default false. true withdraws this membership's access.

Memberships may only exist in additional tenant realms, not in the main Ipseity realm. An identity may have only one membership per tenant; combine its roles and groups in that object. The API rejects duplicates, and login fails closed if GitOps supplies duplicates. A membership can be provisioned before its source principal exists, but cannot be used until that account exists and can log in.

Do not store password, mfa_secret, mfa_enabled, email, email_verified or permissions in a membership: these fields are rejected, including when the object is used directly from GitOps. Credentials and profile come from the home principal. Direct application grants belong in tenant roles/groups. Enabled memberships contribute the login permission automatically; the home principal must independently hold login.

Role and group names behave like other Ipseity assignments: undefined references contribute no permissions. Direct role names still appear in the roles claim, so provision the actual role objects as well. Roles or groups granting ipseity.super (including through *) make the membership unusable. Home roles, groups and administrative permissions are never imported into the tenant.

GitOps and controller provisioning

The complete, directly applicable example is example-membership.yaml. It creates a tenant admins role and an ipseity-adrian membership. It assumes:

  • websites-delountartglass already exists and is a discovered Ipseity realm (normally labelled ipseity.io/realm), or appears in IPSEITY_REALMS.
  • A home principal named adrian exists in ipseity, is enabled and holds login.
  • The delountartglass public OIDC client already exists in the tenant realm, with the CMS callback and allowed scopes.

Apply with:

kubectl apply -f docs/example-membership.yaml

The membership ConfigMap conventions are:

apiVersion: v1
kind: ConfigMap
metadata:
  name: ipseity-membership-ipseity-adrian
  namespace: websites-delountartglass
  labels:
    app: ipseity
    app.kubernetes.io/managed-by: ipseity
    ipseity.io/entity: memberships
    ipseity.io/name: ipseity-adrian
data:
  payload: |-
    {
      "name": "ipseity-adrian",
      "entity": "membership",
      "identity_realm": "ipseity",
      "identity_subject": "adrian",
      "roles": ["admins"],
      "groups": [],
      "disabled": false
    }

If IPSEITY_LABEL_APP or IPSEITY_LABEL_MANAGED_BY is customised, adjust the corresponding labels. The namespace determines the target realm; a realm field in the payload does not select a different target. The ConfigMap name must be ipseity-membership-<payload.name> and its entity selector must be memberships.

The Viking CMS controller can reconcile these ConfigMaps with its normal Kubernetes client. No client secret or user password is needed. It needs get/list/create/update/patch/delete permissions on the ConfigMaps it manages in the website namespace, rather than write access to the home identity namespace. Use a stable membership name and reconcile roles/groups/disabled in data.payload. Directly provisioned memberships are validated again when used for authentication. Ipseity does not rewrite valid membership objects during login.

The conventional managed-by label also means Ipseity's release realm operation removes these objects. Back up memberships with the other tenant entities, or recreate them from GitOps/controller desired state. Coordinate controller cleanup with realm release so a controller does not recreate a deliberately removed grant.

Signing in and Viking CMS configuration

Use the usual tenant CMS login button, which sends its own client_id. In Ipseity's login form enter ipseity/adrian, your existing password, and your home account's current TOTP code if MFA is enabled. Substitute the actual IPSEITY_NAMESPACE if it is not ipseity. This slash-qualified username selects the home identity without colliding with a tenant-local adrian.

An unqualified username continues to select a local principal; ipseity.adrian is also an ordinary local username, not a cross-realm reference. No automatic fallback searches other realms. / and the membership: subject prefix are reserved for membership handling and rejected in new principal names.

The CMS continues to use the global discovery document:

https://<ipseity-host>/oidc/.well-known/openid-configuration

No additional OAuth parameters or realm-specific discovery URLs are needed. Authorization Code with PKCE (S256) and per-client consent work as usual. This membership flow currently supports password + optional TOTP, not home realm external-provider/SSO login. A passwordless home account must use an existing supported tenant-local provider flow instead; memberships do not bridge that flow.

Viking reads its rolesClaim (default roles) and checks allowedRoles; when publishRoles is configured it separately checks publishing permissions. Match the membership's tenant role to these settings. For example, roles: ["admins"] works with allowedRoles: editors admins; include admins in publishRoles if publishing is separately restricted. Request the OIDC roles scope (and groups if mapping groups instead); the client's allowed_scopes must permit them. openid profile roles email is a typical request. The YAML example's role has no Ipseity administration permissions: Viking uses its name for application RBAC.

Tokens, account state and revocation

The tenant realm issues and signs tokens. Membership tokens have:

  • realm: the tenant, e.g. websites-delountartglass.
  • sub: membership:<name>, e.g. membership:ipseity-adrian, in both access and ID tokens. Treat it as an opaque subject; it is not the home username.
  • identity_realm and identity_subject: the home account reference, included in access and ID tokens regardless of optional profile scopes.
  • Profile/email claims from the home account, filtered by OIDC scopes as usual.
  • Roles, groups and permissions from the membership and tenant RBAC only.

Keep names stable across controller reconciliations. Changing the identity behind a membership invalidates that membership's outstanding authorization codes, pending consent, refresh tokens and access-token use through Ipseity; existing sessions cannot transfer to the replacement account. Consent grants are bound to the referenced identity too. Renaming a membership changes sub and creates a different application identity.

At login, home password validation, MFA, lockout and password-hash migration run in the home realm. Failed password attempts across multiple tenants share the home account's lockout counters. Successful membership login emits auth.membership.login in the tenant audit with the home identity reference; password authentication events are recorded in the home audit. API membership changes use the usual entity CRUD audit events; direct Kubernetes changes should be audited by GitOps/Kubernetes.

Consent approval, code exchange, refresh, userinfo, token introspection and authenticated Ipseity API requests recheck the membership and the source account. Disabling/deleting the membership, deleting/disabling the source principal or removing its home login permission blocks these operations. Refreshed tokens use the current tenant role/group assignments. Entity-cache propagation is bounded by IPSEITY_ENTITY_CACHE_TTL_SECONDS (default 5 seconds).

Already-issued JWTs validated offline retain their claims until expiry; deleting a ConfigMap cannot recall them or terminate a CMS's own session cookie. Configure the CMS's session lifetime/revalidation/logout policy accordingly. Membership revocation does not broadcast logout to applications. Logout and account session listing/revocation operate on membership sessions in the tenant; logging out of one tenant does not log out every other tenant or the home console.

Membership sessions can read their account profile and list/revoke their tenant sessions. Password changes, MFA changes, provider unlinking and email verification must be performed through the home account in the main Ipseity realm. Tenant sessions cannot change the home identity's credentials or verification state.

REST API and permissions

Memberships support the standard entity CRUD API:

Endpoint Methods Required permission
/api/memberships GET memberships.read
/api/memberships POST memberships.write
/api/memberships/<name> GET memberships.read
/api/memberships/<name> PUT / POST memberships.write
/api/memberships/<name> DELETE memberships.delete

The corresponding identity.read/write/delete broad grants also satisfy these checks. ipseity-admin-memberships grants the three entity permissions and is included in each realm's ipseity-admins group. Membership management has no dedicated console editor yet; use the API, GitOps or a controller.

A home super administrator targets the tenant with X-Ipseity-Realm: websites-delountartglass using their normal home token; they need the applicable write permission as well as ipseity.super. A tenant administrator with membership permissions can manage its own realm's grants. Creating a membership does not require the referenced person to be a global administrator, and grants nothing in other realms.

curl -X POST 'https://<ipseity-host>/api/memberships' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'X-Ipseity-Realm: websites-delountartglass' \
  -H 'Content-Type: application/json' \
  -d '{"name":"ipseity-adrian","identity_realm":"ipseity","identity_subject":"adrian","roles":["admins"],"groups":[],"disabled":false}'

To suspend access through GitOps, set disabled to true. To remove the grant, delete ipseity-membership-ipseity-adrian from the tenant namespace. Its role object may remain if it is also used by customer-local accounts.