{"record":{"id":"c6d2cd3598bd5892","repo":"BerriAI/litellm","slug":"oauth-2-0-token-validation-failed-e","errorCode":null,"errorMessage":"Oauth 2.0 Token validation failed: {e}","messagePattern":"Oauth 2\\.0 Token validation failed: (.+?)","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"litellm/proxy/auth/oauth2_check.py","lineNumber":210,"sourceCode":"                raise ValueError(\"Token is not active\")\n\n            # Extract user information from response\n            user_id, user_role, user_team_id = Oauth2Handler._extract_user_info(\n                response_data=data,\n                user_id_field_name=user_id_field_name,\n                user_role_field_name=user_role_field_name,\n                user_team_id_field_name=user_team_id_field_name,\n            )\n\n            return UserAPIKeyAuth(\n                api_key=token,\n                team_id=user_team_id,\n                user_id=user_id,\n                user_role=cast(LitellmUserRoles, user_role),\n            )\n        except httpx.HTTPStatusError as e:\n            # This will catch any 4xx or 5xx errors\n            raise ValueError(f\"Oauth 2.0 Token validation failed: {e}\")\n        except Exception as e:\n            # This will catch any other errors (like network issues)\n            raise ValueError(f\"An error occurred during token validation: {e}\")\n","sourceCodeStart":192,"sourceCodeEnd":214,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/auth/oauth2_check.py#L192-L214","documentation":"Except-handler in OAuth2 token validation: an httpx.HTTPStatusError escaped while calling the introspection/userinfo endpoint; the exception text (status, URL, body) is embedded in the 401-raising error.","triggerScenarios":"Thrown at litellm/proxy/auth/oauth2_check.py:210 when the library encounters an invalid state.","commonSituations":"The call to the OAuth2 token info endpoint raised an exception (network error, timeout, or unexpected response).","solutions":["Verify OAUTH_TOKEN_INFO_ENDPOINT is reachable from the proxy and returns a valid response.","Check network connectivity, TLS, and any credentials required by the token info endpoint."],"exampleFix":"curl -v $OAUTH_TOKEN_INFO_ENDPOINT to confirm the endpoint responds correctly.","handlingStrategy":"try-catch","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"}