Significant-Gravitas/AutoGPT · warning · HTTPException

Provider '{provider_key}' does not support OAuth

Error message

Provider '{provider_key}' does not support OAuth

What it means

When building an OAuth flow handler, the router looks up the provider name in HANDLERS_BY_NAME (registry of providers with OAuth support). If provider_key is absent, HTTP 404 "Provider '{provider_key}' does not support OAuth". This fires before any credential checks — the provider simply has no OAuth handler in this deployment.

Source

Thrown at autogpt_platform/backend/backend/api/features/integrations/router.py:1307

def _get_provider_oauth_handler(
    req: Request, provider_name: ProviderName
) -> "BaseOAuthHandler":
    # Ensure blocks are loaded so SDK providers are available
    try:
        from backend.blocks import load_all_blocks

        load_all_blocks()  # This is cached, so it only runs once
    except Exception as e:
        logger.warning(f"Failed to load blocks: {e}")

    # Convert provider_name to string for lookup
    provider_key = (
        provider_name.value if hasattr(provider_name, "value") else str(provider_name)
    )

    if provider_key not in HANDLERS_BY_NAME:
        raise HTTPException(
            status_code=status.HTTP_404_NOT_FOUND,
            detail=f"Provider '{provider_key}' does not support OAuth",
        )

    # Check if this provider has custom OAuth credentials
    oauth_credentials = CREDENTIALS_BY_PROVIDER.get(provider_key)

    if oauth_credentials and not oauth_credentials.use_secrets:
        # SDK provider with custom env vars
        import os

        client_id = (
            os.getenv(oauth_credentials.client_id_env_var)
            if oauth_credentials.client_id_env_var
            else None
        )
        client_secret = (
            os.getenv(oauth_credentials.client_secret_env_var)

View on GitHub (pinned to 9c8bb5550f)

Solutions

  1. Check GET /integrations (provider list) — it shows which providers are configured; only call OAuth routes for providers in that list.
  2. Verify spelling of the provider name against the ProviderName enum values.
  3. If the provider integration is new, update/redeploy the backend so HANDLERS_BY_NAME includes it.
  4. For API-key-only providers, use the API-key credential flow instead of OAuth.

Example fix

# before: assuming every provider supports OAuth
GET /integrations/{provider}/login

# after: gate on providers actually offering OAuth
providers = (await client.get("/integrations")).json()
if provider not in {p["name"] for p in providers if p.get("oauth")}:
    raise SkipOAuth(provider)
Defensive patterns

Strategy: validation

Validate before calling

providers = (await client.get("/integrations")).json()
known = {p["name"] for p in providers}
if provider not in known:
    raise UnsupportedProvider(provider)  # don't call /integrations/{provider}/login

Type guard

def supports_oauth(provider: str, providers_response: list[dict]) -> bool:
    return any(p["name"] == provider for p in providers_response)

Prevention

When it happens

Trigger: GET /integrations/{provider}/login (or any OAuth-starting route) for a provider that only supports API keys (no OAuth handler registered), a misspelled provider name, or a handler available in newer code but not in the deployed version (stale deployment missing a newly added provider integration).

Common situations: Frontend linking to OAuth for a provider whose block uses API-key auth; version skew after a new provider integration is merged — frontend updated, backend not; typos in provider path segments.

Related errors


AI-assisted analysis of Significant-Gravitas/AutoGPT@9c8bb5550f (2026-08-14). Data as JSON: /api/errors/f17a0133aa24e437. Report an issue: GitHub.