Add enterprise IdP identity resolution for MCP OAuth (#40739)

## What changed

- Resolve stored enterprise IdP sessions against discovered authorization
  metadata, requiring the configured issuer, public-client authentication, and
  supported ID-JAG token exchange capabilities.
- Bind OIDC identity claims and MCP resource indicators to their configured
  issuer, client, and server, and require reauthentication when pinned keyring
  credentials are removed or replaced.
- Hold the credential lock while rereading refresh tokens, and isolate
  enterprise credentials by reserved namespace and Codex home.

## Testing

- Cover metadata and claim validation, resource binding, credential replacement
  and keyring failures, refresh locking, expired ID tokens, and credential
  namespace isolation.

GitOrigin-RevId: edce3c6159f7d6831edf72e9608b3fc3f5823c83
This commit is contained in:
Nick Steele authored and copyberry committed 2026-08-25 23:51:57 +00:00
1 parent 75cb7c903d
commit 9b4a0f8a0a
12 files changed
+932 -14

No files matched your search

+7
View File
@@ -3,6 +3,7 @@ mod elicitation_client_service;
mod ema_auth_policy;
mod ema_claims;
mod ema_exchange;
mod ema_identity;
mod event_notification_transport;
mod executor_process_transport;
mod http_client_adapter;
@@ -33,9 +34,15 @@ pub use auth_status::discover_streamable_http_oauth;
pub use codex_protocol::protocol::McpAuthStatus;
pub use ema_auth_policy::EmaAuthFailure;
pub use ema_auth_policy::EmaInvalidGrantSource;
pub use ema_auth_policy::validate_ema_auth_resource;
pub use ema_claims::validate_oidc_identity_assertion;
pub use ema_exchange::EmaAccessToken;
pub use ema_exchange::EmaIdJagExchangeRequest;
pub use ema_exchange::exchange_id_jag;
pub use ema_identity::EmaIdpIdentity;
pub use ema_identity::EmaIdpIdentityRequest;
pub use ema_identity::resolve_ema_idp_identity;
pub use ema_identity::stored_ema_identity_is_usable;
pub use event_notification_transport::EventNotificationReceiver;
pub use http_client_adapter::StreamableHttpRedirectMode;
pub use http_headers::with_http_headers_helper;