namespace ModelContextProtocol.Authentication; /// /// Configuration options for the . /// public sealed class IdentityAssertionGrantProviderOptions { /// /// Gets or sets the MCP client ID used for the JWT Bearer grant (RFC 7523) at the MCP authorization server. /// public required string ClientId { get; set; } /// /// Gets or sets the MCP client secret used for the JWT Bearer grant at the MCP authorization server. /// Optional; only required if the MCP authorization server requires client authentication. /// public string? ClientSecret { get; set; } /// /// Gets or sets the scopes to request from the MCP authorization server (space-separated). Optional. /// public string? Scope { get; set; } /// /// Gets or sets the enterprise Identity Provider base URL for OAuth/OIDC metadata discovery. /// Used to discover IdpTokenEndpoint automatically when is not set. /// Either this or must be provided. /// public string? IdpUrl { get; set; } /// /// Gets or sets the enterprise Identity Provider token endpoint URL for RFC 8693 token exchange. /// When provided, skips IdP metadata discovery. Either this or must be provided. /// public string? IdpTokenEndpoint { get; set; } /// /// Gets or sets the client ID for authentication with the enterprise Identity Provider (RFC 8693 token exchange). /// public required string IdpClientId { get; set; } /// /// Gets or sets the client secret for authentication with the enterprise Identity Provider. Optional. /// public string? IdpClientSecret { get; set; } /// /// Gets or sets the scopes to request from the enterprise Identity Provider (space-separated). Optional. /// public string? IdpScope { get; set; } /// /// Gets or sets the callback that supplies the OIDC ID token for the Cross-Application Access flow. /// /// /// /// This callback is invoked after the MCP resource and authorization server URLs have been discovered. /// It receives a with these URLs and should return the /// OIDC ID token string obtained from the enterprise Identity Provider (e.g., from an SSO login session). /// /// /// The provider will use the returned ID token to internally perform the RFC 8693 token exchange at the /// configured IdP, obtaining a JWT Authorization Grant, which is then exchanged for an access token at /// the MCP authorization server via RFC 7523. /// /// public required IdentityAssertionGrantIdTokenCallback IdTokenCallback { get; set; } }