Skip to main content

authorization_server_metadata

Function authorization_server_metadata 

Source
pub fn authorization_server_metadata(
    server_url: &str,
    config: &OAuthConfig,
) -> Value
Expand description

Build the Authorization Server Metadata JSON response (RFC 8414).

Returned at GET /.well-known/oauth-authorization-server so MCP clients can discover the authorization and token endpoints.

issuer defaults to server_url, the origin this document is served from, as RFC 8414 3.3 requires. The upstream OAuthConfig::issuer remains the token issuer and is still what inbound JWT iss claims are validated against - the two are deliberately different. See OAuthConfig::authorization_server_metadata_issuer for the legacy opt-out.