Register the tool with the platform (LMS): provide your tool's OIDC login initiation URL, target link URI, redirect URIs, and a public JWK endpoint; receive the platform's issuer, client_id, OIDC auth endpoint URL, and JWKS URL.
Handle the OIDC Login Initiation: the LMS POSTs to your oidc_initiation_url with parameters iss, login_hint, target_link_uri, and lti_message_hint; validate that iss and client_id match your registration, generate a nonce and state, store both in a short-lived cookie or session.
Redirect the browser to the platform's OIDC authorization endpoint with query parameters response_type=id_token, response_mode=form_post, scope=openid, client_id, redirect_uri, login_hint (echo back), nonce, state, and lti_message_hint (echo back).
Receive the platform's POST to your redirect_uri containing an id_token JWT; validate the state against your stored value to prevent CSRF, then verify the JWT signature using the platform's public keys fetched from its JWKS endpoint.
Validate the JWT claims: iss matches the registered platform issuer, aud contains your client_id, nonce matches your stored nonce, exp has not passed, and the claim https://purl.imsglobal.org/spec/lti/claim/message_type is LtiResourceLinkRequest.
Extract the LTI context, resource link, roles, and custom claims from the verified JWT payload and use them to provision or identify the user session in your tool.
Known gotchas
The nonce must be single-use and validated against your stored value before accepting the token; replaying a captured id_token is otherwise trivially possible since the flow uses the browser as a relay.
Platform JWKS endpoints should be fetched with a short cache TTL (e.g., 1 hour) rather than at every request; however, always retry fetching fresh keys on signature verification failure before rejecting the token, as platforms rotate keys.
The OIDC flow requires two round-trips through the user's browser before your tool receives the token; if your tool sets SameSite=Strict on the state cookie, the final POST from the LMS will not carry the cookie and validation will fail — use SameSite=None; Secure.
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp