Skip to content
Wallet and Entity Collection draft updates

Build OpenID Federations for OIDC, OAuth & wallets

Create Trust Anchors, Intermediates, and Leaves with one TypeScript API. Add OpenID Connect, OAuth, or digital wallet roles and bring your own keys and protocol engines.

Start with a federation participant

Set up a Trust Anchor

Publish a root of trust and serve signed Subordinate Statements for the participants you enroll.

npm install @oidfed/authority @oidfed/core @oidfed/crypto

Bring your crypto engine and keyring. Use durable storage for a deployed authority.

trust-anchor.ts
import { TrustAnchor } from "@oidfed/authority";
import { MemoryFederationStorage, type CryptoContext } from "@oidfed/core";

export async function createAnchor(crypto: CryptoContext) {
  const entityId = "https://anchor.example";
  const anchor = await TrustAnchor.create({
    entityId,
    crypto,
    storage: new MemoryFederationStorage({ namespace: entityId }),
    metadata: {
      federation_entity: {
        federation_fetch_endpoint: `${entityId}/fetch`,
        federation_list_endpoint: `${entityId}/list`,
      },
    },
  });
  return anchor;
}

The OidFed packages

Construct a host with create(), add the roles it serves, and mount its HTTP handler. Use Core on its own for trust-chain discovery, metadata policy, and Trust Mark checks.

How federation establishes trust

Organizations publish signed statements about themselves and their subordinates. A participant can follow those statements to a Trust Anchor it already trusts, then apply the federation’s policies.

Inspect a federation from your terminal

Use the OidFed CLI to resolve trust chains, verify signatures, and query federation endpoints. It ships with 17 commands.

npm install -g @oidfed/cli
CLI reference

Example command

oidfed --json resolve https://op.example --trust-anchor https://ta.example

Example output

{
  "chains_found": 1,
  "errors": 0,
  "chains": [{
    "entity_id": "https://op.example",
    "trust_anchor_id": "https://ta.example",
    "statements": 3,
    "expires_at": "2030-01-01T12:00:00.000Z"
  }]
}