6.8. Retrieve a subject’s Trust Mark
Feature guides / 6. Trust Marks · Example context
Car Rental Company can retrieve a mark that the auditor has already issued, or receive its JWT through a separate administrative channel. Retrieval endpoint.
Retrieve and publish in one operation
import type { TrustAnchorSet } from "@oidfed/core";
import type { Leaf } from "@oidfed/leaf";
export async function retrieveVerifierMark(shop: Leaf, trustAnchors: TrustAnchorSet) {
await shop.fetchAndAttachTrustMark({
issuer: "https://auditor.example",
trustMarkType: "https://licence-federation.example/marks/approved-verifier", trustAnchors,
});
return shop.getTrustMarks();
}
The holder establishes issuer trust, uses the issuer's authenticated EC endpoint, retrieves a JWT, validates it for itself, and signs an updated EC. The operation shares its fetch budget and cancellation controls. For offline delivery, call attachTrustMark() with supplied issuer evidence instead.
fetchTrustMark(endpoint, { trustMarkType, sub }, options) remains available when the application wants to retrieve without publication. Validate its returned JWT before relying on it. Third-party retrieval is allowed; request authentication identifies the caller and does not implicitly require that caller to equal sub.
Authenticated clients send form POST requests with the configured method. private_key_jwt uses the responder's Entity Identifier as aud. Custom methods may supply credential headers or parameters. A request never authorizes new issuance; the endpoint selects an eligible stored mark or returns not found.
When retrieval uses authentication, its audience must match the verified issuer’s Entity Identifier. fetchAndAttachTrustMark() checks this before preparing credentials or contacting the issuer’s Trust Mark endpoint. The endpoint itself may be hosted on another origin.
Retrieve an existing accreditation decision
The retrieval endpoint returns a mark the auditor has already issued for Car Rental Company. It is not an enrollment or approval endpoint. Authenticate as required by the endpoint metadata and keep caller credentials separate from selectors such as subject and type.
Validate the returned JWT before attaching it or using its claims. If no suitable mark exists, route the operator back to the accreditation process instead of repeatedly requesting issuance over the public endpoint. A changed JWT may be a renewal; retain the exact bytes needed for later validation or status queries.
For operations that contact several entities, supply options.getEndpointAuthentication({ endpoint, responder, signal }). Choose credentials from your application's approved endpoint/entity configuration, or return undefined for anonymous access. A callback error stops that request. Use this callback instead of static authentication; Entity Configuration discovery remains anonymous GET. The Collection guide shows how LIGO Wiki can choose credentials for each authority.