{"record":{"id":"f17a0133aa24e437","repo":"Significant-Gravitas/AutoGPT","slug":"provider-provider-key-does-not-support-oauth","errorCode":null,"errorMessage":"Provider '{provider_key}' does not support OAuth","messagePattern":"Provider '(.+?)' does not support OAuth","errorType":"http","errorClass":"HTTPException","httpStatus":404,"severity":"warning","filePath":"autogpt_platform/backend/backend/api/features/integrations/router.py","lineNumber":1307,"sourceCode":"\ndef _get_provider_oauth_handler(\n    req: Request, provider_name: ProviderName\n) -> \"BaseOAuthHandler\":\n    # Ensure blocks are loaded so SDK providers are available\n    try:\n        from backend.blocks import load_all_blocks\n\n        load_all_blocks()  # This is cached, so it only runs once\n    except Exception as e:\n        logger.warning(f\"Failed to load blocks: {e}\")\n\n    # Convert provider_name to string for lookup\n    provider_key = (\n        provider_name.value if hasattr(provider_name, \"value\") else str(provider_name)\n    )\n\n    if provider_key not in HANDLERS_BY_NAME:\n        raise HTTPException(\n            status_code=status.HTTP_404_NOT_FOUND,\n            detail=f\"Provider '{provider_key}' does not support OAuth\",\n        )\n\n    # Check if this provider has custom OAuth credentials\n    oauth_credentials = CREDENTIALS_BY_PROVIDER.get(provider_key)\n\n    if oauth_credentials and not oauth_credentials.use_secrets:\n        # SDK provider with custom env vars\n        import os\n\n        client_id = (\n            os.getenv(oauth_credentials.client_id_env_var)\n            if oauth_credentials.client_id_env_var\n            else None\n        )\n        client_secret = (\n            os.getenv(oauth_credentials.client_secret_env_var)","sourceCodeStart":1289,"sourceCodeEnd":1325,"githubUrl":"https://github.com/Significant-Gravitas/AutoGPT/blob/9c8bb5550f446ba5d3046b78896578742495b3cf/autogpt_platform/backend/backend/api/features/integrations/router.py#L1289-L1325","documentation":"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.","triggerScenarios":"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).","commonSituations":"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.","solutions":["Check GET /integrations (provider list) — it shows which providers are configured; only call OAuth routes for providers in that list.","Verify spelling of the provider name against the ProviderName enum values.","If the provider integration is new, update/redeploy the backend so HANDLERS_BY_NAME includes it.","For API-key-only providers, use the API-key credential flow instead of OAuth."],"exampleFix":"# before: assuming every provider supports OAuth\nGET /integrations/{provider}/login\n\n# after: gate on providers actually offering OAuth\nproviders = (await client.get(\"/integrations\")).json()\nif provider not in {p[\"name\"] for p in providers if p.get(\"oauth\")}:\n    raise SkipOAuth(provider)","handlingStrategy":"validation","validationCode":"providers = (await client.get(\"/integrations\")).json()\nknown = {p[\"name\"] for p in providers}\nif provider not in known:\n    raise UnsupportedProvider(provider)  # don't call /integrations/{provider}/login","typeGuard":"def supports_oauth(provider: str, providers_response: list[dict]) -> bool:\n    return any(p[\"name\"] == provider for p in providers_response)","tryCatchPattern":null,"preventionTips":["Fetch the provider list at app start and gate OAuth entry points on it.","Keep backend and frontend versions in sync when adding new provider integrations."],"tags":["oauth","http-404","provider-registry","version-skew"],"backgroundTag":null,"analyzedSha":"9c8bb5550f446ba5d3046b78896578742495b3cf","analyzedAt":"2026-08-14T17:17:21.957Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}