INNER CODE UNIT · Rust
run_auth_preregistered_client
modelcontextprotocol/rust-sdk · conformance/src/bin/client.rs:632
async fn run_auth_preregistered_client(
server_url: &str,
ctx: &ConformanceContext,
) -> anyhow::Result<()> {
let client_id = ctx
.client_id
.as_deref()
.ok_or_else(|| anyhow::anyhow!("Missing client_id in context"))?;
let client_secret = ctx
.client_secret
.as_deref()
.ok_or_else(|| anyhow::anyhow!("Missing client_secret in context"))?;
let auth_client =
perform_oauth_flow_preregistered(server_url, client_id, client_secret).await?;
let transport = StreamableHttpClientTransport::with_client(
auth_client,