Skip to content
Wallet and Entity Collection draft updates
Documentation menu

7.4. Retrieve authenticated historical federation keys

Feature guides / 7. Federation endpoints · Example context

eduGAIN rotated a signing key after issuing a JWT that a consumer still needs to examine. A historical key response records old public keys and their lifecycle information.

How to use it

Publish federation_historical_keys_endpoint in the Authority's federation metadata. The configured lifecycle provider supplies the history; getHistoricalKeys() signs it and handleRequest() serves the endpoint. Trust Mark consumers normally configure automatic historical lookup on their host or role rather than fetching and selecting keys themselves. Historical keys.

import type { TrustAnchor, Intermediate } from "@oidfed/authority";

export function campusHistory(campus: TrustAnchor | Intermediate) {
  return campus.getHistoricalKeys(); // Signed using the host's current federation signer.
}
export function serveCampus(campus: TrustAnchor | Intermediate) {
  return (request: Request) => campus.handleRequest(request);
}

Retrieve history for a custom verifier

For a verifier outside an existing host or protocol workflow, core provides the remote client. It verifies the response, not the older artifact you intend to check:

import type { CryptoEngine } from "@oidfed/crypto";
import { fetchHistoricalKeys, type JWKSet } from "@oidfed/core";

export function remoteCampusHistory(engine: CryptoEngine, currentTrustedKeys: JWKSet) {
  return fetchHistoricalKeys("https://edugain.example/historical-keys", currentTrustedKeys, {
    engine,
    expectedIssuer: "https://edugain.example",
  });
}

Check the Result before selecting a key. Standalone selection uses selectHistoricalVerificationKey(); the historical Trust Mark workflow composes that step automatically.

What your application owns

Retain accurate activation, expiry, and revocation records in the keyring. Establish trust in the current response signer independently of the historical key being sought. Old-key availability does not extend an artifact's expiry or prove current accreditation. The shared historical-key selector enforces finite signing time, key iat/nbf lower bounds, exclusive exp, and explicit revocation policy. Trust Mark verification can opt into missing-key history lookup or use supplied offline responses; see the mark workflow.

Retain enough history for surviving artifacts

When eduGAIN rotates keys, existing signed artifacts may still need verification. Keep the relevant public history and validity information available for the lifetimes your federation supports. Never publish private signing material through the history endpoint.

Consumers establish trust in the history source and validate the signed response before selecting a key. A historical key answers which public key was used during an interval; it does not automatically restore trust in an expired chain or revoked artifact. Coordinate history retention with Trust Mark lifetimes and your offline requirements.

Next: 7.5. Authenticate federation endpoint clients

View source on GitHub