openai/codex · error · anyhow::Error

OAuth provider did not return credentials

Error message

OAuth provider did not return credentials

What it means

Error "OAuth provider did not return credentials" thrown in openai/codex.

Source

Thrown at codex-rs/rmcp-client/src/perform_oauth_login.rs:657

                state: csrf_state,
                issuer,
            } = match callback {
                CallbackResult::Success(callback) => callback,
                CallbackResult::Error(error) => return Err(anyhow!(error)),
            };

            self.oauth_state
                .handle_callback_with_issuer(&code, &csrf_state, issuer.as_deref())
                .await
                .context("failed to handle OAuth callback")?;

            let (client_id, credentials_opt) = self
                .oauth_state
                .get_credentials()
                .await
                .context("failed to retrieve OAuth credentials")?;
            let credentials = credentials_opt
                .ok_or_else(|| anyhow!("OAuth provider did not return credentials"))?;

            let expires_at = compute_expires_at_millis(&credentials);
            let stored = StoredOAuthTokens {
                server_name: self.server_name.clone(),
                url: self.server_url.clone(),
                issuer: self.authorization_server_issuer.clone(),
                client_id,
                token_response: WrappedOAuthTokenResponse(credentials),
                expires_at,
            };
            save_oauth_tokens(
                &self.server_name,
                &stored,
                self.store_mode,
                self.keyring_backend_kind,
            )?;

            Ok(())

View on GitHub (pinned to 339751715c)

When it happens

Trigger: Thrown at codex-rs/rmcp-client/src/perform_oauth_login.rs:657 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/968c98d9978f4576. Report an issue: GitHub.