Discovers the IdP's token endpoint and requests a JWT Authorization Grant.
This is a convenience wrapper around requestJwtAuthorizationGrant that first performs OAuth metadata discovery to find the token endpoint.
requestJwtAuthorizationGrant
Configuration including IdP URL for discovery
The JWT Authorization Grant and related metadata
If discovery fails or the token exchange fails
const result = await discoverAndRequestJwtAuthGrant({ idpUrl: 'https://idp.example.com', audience: 'https://auth.chat.example/', resource: 'https://mcp.chat.example/', idToken: await getIdToken(), clientId: 'my-idp-client', clientSecret: 'my-idp-secret'}); Copy
const result = await discoverAndRequestJwtAuthGrant({ idpUrl: 'https://idp.example.com', audience: 'https://auth.chat.example/', resource: 'https://mcp.chat.example/', idToken: await getIdToken(), clientId: 'my-idp-client', clientSecret: 'my-idp-secret'});
Discovers the IdP's token endpoint and requests a JWT Authorization Grant.
This is a convenience wrapper around
requestJwtAuthorizationGrantthat first performs OAuth metadata discovery to find the token endpoint.