zeroclaw-labs/zeroclaw · error

Google OAuth error: {} - {}

Error message

Google OAuth error: {} - {}

What it means

Error "Google OAuth error: {} - {}" thrown in zeroclaw-labs/zeroclaw.

Source

Thrown at crates/zeroclaw-providers/src/auth/gemini_oauth.rs:126

        ("code_verifier", &pkce.code_verifier),
    ];

    let response = client
        .post(GOOGLE_OAUTH_TOKEN_URL)
        .form(&form)
        .send()
        .await
        .context("Failed to send token exchange request")?;

    let status = response.status();
    let body = response
        .text()
        .await
        .context("Failed to read token response body")?;

    if !status.is_success() {
        if let Ok(err) = serde_json::from_str::<OAuthErrorResponse>(&body) {
            anyhow::bail!(
                "Google OAuth error: {} - {}",
                err.error,
                err.error_description.unwrap_or_default()
            );
        }
        anyhow::bail!("Google OAuth token exchange failed ({}): {}", status, body);
    }

    let token_response: TokenResponse =
        serde_json::from_str(&body).context("Failed to parse token response")?;

    let expires_at = token_response
        .expires_in
        .map(|secs| Utc::now() + chrono::Duration::seconds(secs));

    Ok(TokenSet {
        access_token: token_response.access_token,
        refresh_token: token_response.refresh_token,

View on GitHub (pinned to 88bb9c8533)

Solutions

  1. Read the Google OAuth error code and description; fix client ID/secret or requested scopes accordingly.

When it happens

Trigger: Thrown at crates/zeroclaw-providers/src/auth/gemini_oauth.rs:126 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of zeroclaw-labs/zeroclaw@88bb9c8533 (2026-08-23). Data as JSON: /api/errors/044f2ff5bec57723. Report an issue: GitHub.