Skip to content
Wallet and Entity Collection draft updates
Documentation menu

1.2. Configure the anchors your application trusts

Feature guides / 1. Federation participants · Example context

LIGO Wiki accepts universities in eduGAIN. Its deployment starts with an independently trusted identity and public key set for that anchor, rather than accepting whichever root a visitor presents.

How to use it

Configure trustAnchors on the Leaf, TrustAnchor, or Intermediate that performs the operation. Attached protocol roles can use those anchors, or explicitly override them for a narrower trust decision. Core supplies the shared TrustAnchorSet representation and its factory; neither authenticates the initial keys for you.

import { Leaf } from "@oidfed/leaf";
import { createTrustAnchorSet, type CryptoContext, type JWKSet } from "@oidfed/core";

export async function ligoWiki(keys: CryptoContext, independentlyVerifiedKeys: JWKSet) {
  const trustAnchors = createTrustAnchorSet([{
    entityId: "https://edugain.example", jwks: independentlyVerifiedKeys,
  }]);
  return await Leaf.create({
    entityId: "https://wiki.ligo.example", authorityHints: ["https://incommon.example"],
    crypto: keys, trustAnchors, metadata: { federation_entity: {} },
  });
}

What your application owns

Provision and rotate these pins through an authenticated administrative process. A fetched self-signed root EC does not authorize replacing a pin. compareTrustAnchorKeys() can compare supplied sets; it does not provide independent delivery. Choose which anchors each operation accepts: an application may have broader federation membership than the anchors suitable for a particular recipient or accreditation decision.

Introduce trust deliberately

LIGO Wiki needs an authenticated way to receive eduGAIN's identifier and public keys before its first discovery request. That can be deployment configuration maintained by its operator. Downloading an arbitrary entity's self-signed configuration tells you which keys it claims, but does not make it a trusted anchor.

Keep the configured anchor set separate from hints encountered during discovery. When adding another federation, review its anchor keys and policy before adding it to the set. When removing trust, decide how existing sessions and cached assessments should be handled; replacing configuration does not revoke tokens or sessions your application has already issued.

Trusted anchors and independent key retrieval

Federation §10 requires the target's identifier, trusted anchor identifiers, and the anchors' public signing keys before establishing trust. §10.2 requires validation against the anchor's public key. The operator supplies these inputs through TrustAnchorSet. Discovery and collection results do not add anchors to that set.

§11.3 says an independent source of Trust Anchor public keys is RECOMMENDED. Those keys SHOULD be compared with the Entity Configuration keys. If they differ, both sets SHOULD be retrieved again. The operator SHOULD define how to handle a persistent mismatch.

Core's compareTrustAnchorKeys(ecJwks, independentJwks, entityId) compares supplied key identifiers and JWK thumbprints. Check match and any inputErrors; malformed or uncomparable sets require investigation before relying on agreement. The operator chooses the independent source and mismatch policy under §11.3. Your application retrieves the keys and runs the comparisons; the function makes no network requests or automatic corrections. The specification sets no fixed comparison schedule.

An anchor can also have a Superior

eduGAIN may be the trust root for LIGO Wiki while participating under a national academic federation. Configure this entity as a TrustAnchor with nonempty authorityHints. It can still publish and update its Trust Mark issuer and owner policy. trustAnchorHints is also permitted when it has Superiors.

The policy matters when a verifier selects eduGAIN as its Trust Anchor. A verifier following the path to the national anchor evaluates the campus entity in its intermediate position instead. An anchor without Superiors must omit both hint claims. This is the dual role described by Federation §4.1.

Next: 1.3. Enroll a subordinate

View source on GitHub