{"record":{"id":"83f6f779eb2a0a87","repo":"BerriAI/litellm","slug":"oauth-error-oauth-error-error-description-oa","errorCode":null,"errorMessage":"OAuth error: {oauth_error}, error_description: {oauth_error_description}","messagePattern":"OAuth error: (.+?), error_description: (.+?)","errorType":"http","errorClass":"HTTPException","httpStatus":401,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":1978,"sourceCode":"            )\n\n        user_role = LitellmUserRoles.PROXY_ADMIN.value\n\n    return user_role\n\n\n@router.get(\"/sso/callback\", tags=[\"experimental\"], include_in_schema=False)\nasync def auth_callback(request: Request, state: str | None = None):\n    \"\"\"Verify login\"\"\"\n    verbose_proxy_logger.info(\"Starting SSO callback with state: %s\", state)\n\n    oauth_error: Final = request.query_params.get(\"error\")\n    if oauth_error:\n        oauth_error_description: Final = request.query_params.get(\"error_description\")\n        verbose_proxy_logger.warning(\n            \"SSO callback received OAuth error: %s, description: %s\", oauth_error, oauth_error_description\n        )\n        raise HTTPException(\n            status_code=401,\n            detail=f\"OAuth error: {oauth_error}\"\n            + (f\", error_description: {oauth_error_description}\" if oauth_error_description else \"\"),\n        )\n\n    # Check if this is a CLI login (state starts with our CLI prefix)\n    from litellm.constants import LITELLM_CLI_SESSION_TOKEN_PREFIX\n    from litellm.proxy._types import LiteLLM_JWTAuth\n    from litellm.proxy.auth.handle_jwt import JWTHandler\n    from litellm.proxy.proxy_server import (\n        general_settings,\n        jwt_handler,\n        master_key,\n        prisma_client,\n        user_api_key_cache,\n    )\n\n    if prisma_client is None:","sourceCodeStart":1960,"sourceCodeEnd":1996,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L1960-L1996","documentation":"Error \"OAuth error: {oauth_error}, error_description: {oauth_error_description}\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:1978 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the OAuth error and description returned by the provider; verify client id/secret, redirect URIs, and provider app configuration."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8","analyzedAt":"2026-08-18T11:44:31.656Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}