auth.group.sso.connection

The auth.group.sso.connection namespace manages group SSO records. Each record links a group (tenant) to an identity provider configuration. It is also the root namespace for group connection domain management through auth.group.sso.connection.domain.*. The returned connectionId is passed to the rest of the group SSO APIs.

This page documents the server-side helper API: auth.group.sso.connection.*. If you want client-callable admin RPC like api.auth.group.createConnection, expose app-owned group SSO wrappers first.

Methods

MethodSignatureReturnsDescription
create(ctx, { groupId, slug?, name?, status?, domains?, ... }){ connectionId, groupId }Creates a new SSO connection for a group.
get(ctx, connectionId)Doc \| nullFetches a connection by ID.
getByDomain(ctx, domain)Doc \| nullLooks up a connection by email domain.
list(ctx, { where?, limit?, cursor?, orderBy?, order? })Paginated listLists SSO connections with optional filtering and sorting.
update(ctx, connectionId, data){ connectionId }Updates connection fields (status, metadata, domains, etc.).
delete(ctx, connectionId){ connectionId }Deletes an SSO connection.
status(ctx, connectionId)Status objectReturns readiness and per-protocol status for the connection.

Domain methods

The auth.group.sso.connection.domain namespace manages domains owned by the connection.

MethodSignatureReturnsDescription
list(ctx, connectionId)Domain listLists domains attached to the connection.
status(ctx, connectionId)Onboarding statusReturns trust status, pending challenges, warnings, and recommended next steps.
validate(ctx, connectionId)Status infoReturns onboarding diagnostics for domains.
set(ctx, connectionId, domains){ connectionId, domains }Replaces the connection’s full domain set and returns the canonical result.
verification.request(ctx, { connectionId, domain })Verification challengeIssues a DNS TXT verification challenge for an attached domain.
verification.confirm(ctx, { connectionId, domain })Confirmation resultResolves the TXT record and marks the domain verified on success.

Example

// Create an SSO connection for a tenant
const { connectionId } = await auth.group.sso.connection.create(ctx, {
  groupId: orgId,
  slug: "acme",
  name: "Acme SSO",
  status: "active",
});

// Replace the attached group connection domains
const domainResult = await auth.group.sso.connection.domain.set(ctx, connectionId, [
  { domain: "acme.com", isPrimary: true },
  { domain: "login.acme.com" },
]);

const challenge = await auth.group.sso.connection.domain.verification.request(ctx, {
  connectionId,
  domain: "acme.com",
});

const confirmation = await auth.group.sso.connection.domain.verification.confirm(ctx, {
  connectionId,
  domain: "acme.com",
});

const domains = await auth.group.sso.connection.domain.list(ctx, connectionId);

const domainStatus = await auth.group.sso.connection.domain.status(ctx, connectionId);

// Inspect domain onboarding readiness
const diagnostics = await auth.group.sso.connection.domain.validate(ctx, connectionId);

// Check connection health
const status = await auth.group.sso.connection.status(ctx, connectionId);

Trust semantics

Verified domains establish trusted ownership for a connection.

  • domain-based SSO discovery should rely on verified domains
  • primary-domain verification is the clearest signal that a connection is ready
  • automatic account linking is only safe when your linking policy allows it and the connection has verified domain ownership

Use domain.status(...) when building onboarding UIs. It returns the current primary domain, verified domains, pending DNS challenges, warnings, and the next recommended admin steps.

verification.request(...) also acts as the renewal path for expired TXT challenges.