openai/codex · error
OAuth token endpoint origin does not match the…
Error message
OAuth token endpoint origin does not match the authorization server origin without issuer-bound callbacks
What it means
Security validation in validate_authorization_server_endpoints: the token endpoint's URL origin differs from the authorization server's issuer origin without issuer-bound callback support, which risks sending client credentials to a host that may not be the real authorization server. Same allowlist of known servers applies as for the authorization endpoint.
Solutions
- Host the token endpoint on the same origin as the advertised issuer
- Advertise authorization_response_iss_parameter_supported so issuer-bound validation applies
- Add the server to the allowlist only if the origin mismatch is verified as legitimate
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at codex-rs/rmcp-client/src/oauth/issuer_binding.rs:68 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/dca0ca500f5b2ea9.
Report an issue: GitHub.
Appendix: source
Thrown at codex-rs/rmcp-client/src/oauth/issuer_binding.rs:68
"https://api.figma.com/",
"https://www.figma.com",
"https://api.figma.com",
) | (
"https://agent.robinhood.com/mcp/trading",
"https://robinhood.com",
"https://api.robinhood.com",
)
)
{
return Ok(());
}
bail!(
"OAuth authorization endpoint origin does not match the authorization server origin without issuer-bound callbacks"
);
}
if token_endpoint.origin() != authorization_endpoint.origin() {
bail!(
"OAuth token endpoint origin does not match the authorization server origin without issuer-bound callbacks"
);
}
Ok(())
}
/// Verifies that a stored refresh token remains bound to its original issuer.
///
/// Call this with the same metadata snapshot that RMCP will use for the credentials. Missing or
/// changed issuers require a new login rather than risking sending a refresh token to a different
/// authorization server.
pub(crate) fn validate_refresh_token_issuer(
metadata: &AuthorizationMetadata,
tokens: &StoredOAuthTokens,
) -> Result<()> {
if !tokens.has_refresh_token() {
return Ok(());View on GitHub (pinned to 339751715c)