ExMCP.Authorization.IdJagHandler (ex_mcp v0.9.0)
View SourceServer-side handler for processing ID-JAG tokens in JWT bearer grants.
Used by MCP authorization servers to validate incoming ID-JAG assertions and issue access tokens in the enterprise-managed authorization flow.
Summary
Functions
Fetches JWKS from an IdP's jwks_uri endpoint.
Processes a JWT bearer grant containing an ID-JAG.
Functions
@spec fetch_idp_keys(String.t()) :: {:ok, [JOSE.JWK.t()]} | {:error, term()}
Fetches JWKS from an IdP's jwks_uri endpoint.
Processes a JWT bearer grant containing an ID-JAG.
- Extracts and identifies the ID-JAG assertion
- Identifies the IdP from the
issclaim - Fetches/caches IdP JWKS
- Validates the ID-JAG
- Returns validated claims for access token issuance
Options
:assertion(required) - The JWT bearer assertion (ID-JAG):expected_audience(required) - This AS's issuer URI:expected_resource(required) - The MCP server resource URI:trusted_idps(required) - Map of trusted IdP issuers to their config Each IdP config should have:jwks_urior:jwks(list of JWKs):jwks_cache- Optional cache (map of issuer -> JWKs) for performance:max_lifetime- Maximum ID-JAG lifetime (default: 600)