Skip to content
Wallet and Entity Collection draft updates
Documentation menu

15. OIDC and OAuth workflows

Feature guides

Maya signs in at Umeå University OP to use LIGO Wiki or Research Portal. Federation provides discovery, effective metadata, and registration evidence; the applications still run their OIDC and OAuth engines. Federation §12 and OIDC/OAuth specifications.

Attach the OIDC or OAuth role to a federation host, then call its registration and Request Object operations at the protocol boundary. Roles perform their own federation discovery and key resolution; the host application does not need to rebuild those steps with core helpers.

Example context

Meet the academic federation from Appendix A

eduGAIN is the selected Trust Anchor. SWAMID and InCommon are its Intermediates in this example. SWAMID enrolls Umeå University, which enrolls its OP; InCommon enrolls the LIGO Wiki, which acts as the RP. Maya is the researcher signing in at her university to use the wiki.

This follows the illustrative topology in Federation Appendix A. The runnable examples use reserved .example addresses, not production services. The additional Research Portal and Research API are supplementary examples for roles beyond that topology. Example identifiers keep those actors distinct.

From federation membership to a protocol session

Maya wants to use LIGO Wiki with her Umeå account. LIGO Wiki establishes trust in Umeå's OP metadata and registers through the supported federation flow. Umeå checks the RP's evidence and policy before accepting the client. The existing OIDC engines then conduct the authorization interaction and manage Maya's session.

Choose automatic or explicit registration according to the advertised capabilities. Keep the validated registration metadata and evidence deadlines with the host's client record. Accreditation requirements run before the acceptance effects they protect, while protocol adapters connect the result to the application's own persistence and response handling.

OAuth-only clients and authorization servers use their corresponding roles and metadata profile. They do not need to invent OIDC fields. In either profile, this library supplies the federation boundary; the application remains responsible for grants, tokens, consent, session binding, and access control.

Work through this topic

Connect registration results to client storage, login, consent, token processing, and expiry handling. This protocol group follows the base and extension guides so the complete sign-in workflow is kept together.

Federation registration stops short of completing Maya’s login. The OP and RP engines still process the authorization response, tokens, and session.

OIDC federation

@oidfed/oidc creates and validates the federation registration artifacts defined in Federation §12.1 and §12.2. Under oidfed's integration boundary, your OP/RP implementation handles authentication, tokens, sessions, registration persistence, and client-secret custody. Role hooks pass accepted registrations to that implementation. Authority storage does not provide an OIDC client database.

Explicit registration omits registration-management credentials by default. If you enable registrationManagement: "read-only", your adapter may return registration_access_token together with registration_client_uri. The host issues and stores the token, serves the URI, and manages revocation. Under §12.2.2, this token MUST NOT allow client metadata changes. Enforce that restriction at your endpoint; the library can validate the response fields but cannot determine a token's permissions. A client_secret_expires_at of 0 means no secret expiry, not an exemption from registration renewal.

Federation §12.3 sets two lifetime limits:

  • An OP registration MUST NOT outlive the RP Trust Chain used to establish it. The OP may expire it earlier or reevaluate it periodically.
  • An RP MUST NOT use a registration past the OP Trust Chain's expiry. Before continuing, an automatically registered RP must successfully reevaluate OP trust; an explicitly registered RP must successfully renew registration.

The explicit-registration handler caps registration expiry to the selected RP chain under §12.2.2 and includes that expiry in the signed response under §12.2.3. OP-side automatic processing returns ProcessedRegistration.trustChain. RP-side automatic and explicit registration return the selected OP chain's expiry as trustChainExpiresAt.

To meet §12.3, retain these validated deadlines and enforce them when processing registrations and requests. For explicit registration, renew before the earlier of the returned expiresAt and trustChainExpiresAt. A response JWT's expiry does not enforce your client record's lifetime by itself.

onRegistration receives client metadata and an optional secret, but no chain deadline. To enforce §12.3, your protocol integration must also associate each registration with the evidence and expiry used to establish trust.

§12.1.1.1 defines one-time use of automatic-registration Request Objects, with an exception for negotiated reuse. oidfed's OP role enforces one-time use through its own configured ReplayStore; it does not inherit the host's store. Your application also manages protocol-key rotation and publication under the protocol-key contracts.

Next: 15.1. Connect OP and RP roles to federation hosts

View source on GitHub