{"record":{"id":"d646664992645dc7","repo":"openai/codex","slug":"unsupported-oauth-http-redirect-policy","errorCode":null,"errorMessage":"unsupported OAuth HTTP redirect policy","messagePattern":"unsupported OAuth HTTP redirect policy","errorType":"exception","errorClass":"OAuthHttpClientAdapterError","httpStatus":null,"severity":"error","filePath":"codex-rs/rmcp-client/src/oauth_http_client.rs","lineNumber":43,"sourceCode":"use rmcp::transport::auth::OAuthHttpClient;\nuse rmcp::transport::auth::OAuthHttpClientError;\nuse rmcp::transport::auth::OAuthHttpClientFuture;\nuse rmcp::transport::auth::OAuthHttpRedirectPolicy;\nuse rmcp::transport::auth::OAuthHttpRequest;\nuse url::Origin;\nuse url::Url;\n\nuse crate::auth_status::OAuthDiscoveryTimeout;\nuse crate::http_client_adapter::StreamableHttpRedirectMode;\nuse crate::utils::MCP_USER_AGENT;\n\nconst MAX_OAUTH_HTTP_RESPONSE_BODY_BYTES: usize = 1024 * 1024;\nconst MAX_OAUTH_HTTP_REDIRECTS: usize = 10;\nstatic NEXT_OAUTH_REQUEST_ID: AtomicU64 = AtomicU64::new(0);\n\n#[derive(Debug, thiserror::Error)]\nenum OAuthHttpClientAdapterError {\n    #[error(\"unsupported OAuth HTTP redirect policy\")]\n    UnsupportedRedirectPolicy,\n    #[error(\"OAuth HTTP request timed out\")]\n    TimedOut,\n    #[error(\"OAuth HTTP request exceeded {MAX_OAUTH_HTTP_REDIRECTS} redirects\")]\n    TooManyRedirects,\n    #[error(\"OAuth HTTP response body exceeds {maximum_bytes} bytes\")]\n    ResponseBodyTooLarge { maximum_bytes: usize },\n    #[error(\"OAuth authorization server issuer does not match authorization metadata origin\")]\n    AuthorizationMetadataIssuerOriginMismatch,\n}\n\nfn oauth_http_client_error(\n    error: impl std::error::Error + Send + Sync + 'static,\n) -> OAuthHttpClientError {\n    Box::new(error)\n}\n\n#[derive(Clone)]","sourceCodeStart":25,"sourceCodeEnd":61,"githubUrl":"https://github.com/openai/codex/blob/339751715c64496cb86246bfb3935f40e309dd3d/codex-rs/rmcp-client/src/oauth_http_client.rs#L25-L61","documentation":"Variant of the OAuthHttpClientAdapterError enum in the OAuth HTTP client adapter: the rmcp layer requested an OAuthHttpRedirectPolicy that this adapter does not implement, so the discovery/registration request is rejected instead of following redirects incorrectly.","triggerScenarios":"Thrown at codex-rs/rmcp-client/src/oauth_http_client.rs:43 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a supported redirect policy value when constructing the OAuth HTTP client","Extend the adapter to handle the requested policy","Audit which caller passes the unsupported policy enum variant"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"339751715c64496cb86246bfb3935f40e309dd3d","analyzedAt":"2026-08-25T05:35:09.876Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}