openai/codex · error · OAuthHttpClientAdapterError
unsupported OAuth HTTP redirect policy
Error message
unsupported OAuth HTTP redirect policy
What it means
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.
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
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/rmcp-client/src/oauth_http_client.rs:43 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of openai/codex@339751715c (2026-08-25).
Data as JSON: /api/errors/d646664992645dc7.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/rmcp-client/src/oauth_http_client.rs:43
use rmcp::transport::auth::OAuthHttpClient;
use rmcp::transport::auth::OAuthHttpClientError;
use rmcp::transport::auth::OAuthHttpClientFuture;
use rmcp::transport::auth::OAuthHttpRedirectPolicy;
use rmcp::transport::auth::OAuthHttpRequest;
use url::Origin;
use url::Url;
use crate::auth_status::OAuthDiscoveryTimeout;
use crate::http_client_adapter::StreamableHttpRedirectMode;
use crate::utils::MCP_USER_AGENT;
const MAX_OAUTH_HTTP_RESPONSE_BODY_BYTES: usize = 1024 * 1024;
const MAX_OAUTH_HTTP_REDIRECTS: usize = 10;
static NEXT_OAUTH_REQUEST_ID: AtomicU64 = AtomicU64::new(0);
#[derive(Debug, thiserror::Error)]
enum OAuthHttpClientAdapterError {
#[error("unsupported OAuth HTTP redirect policy")]
UnsupportedRedirectPolicy,
#[error("OAuth HTTP request timed out")]
TimedOut,
#[error("OAuth HTTP request exceeded {MAX_OAUTH_HTTP_REDIRECTS} redirects")]
TooManyRedirects,
#[error("OAuth HTTP response body exceeds {maximum_bytes} bytes")]
ResponseBodyTooLarge { maximum_bytes: usize },
#[error("OAuth authorization server issuer does not match authorization metadata origin")]
AuthorizationMetadataIssuerOriginMismatch,
}
fn oauth_http_client_error(
error: impl std::error::Error + Send + Sync + 'static,
) -> OAuthHttpClientError {
Box::new(error)
}
#[derive(Clone)]View on GitHub (pinned to 339751715c)