{"record":{"id":"1f83e95b5a87bd00","repo":"BerriAI/litellm","slug":"custom-ui-sso-sign-in-handler-is-not-configured-p","errorCode":null,"errorMessage":"custom_ui_sso_sign_in_handler is not configured. Please set it in general_settings.","messagePattern":"custom_ui_sso_sign_in_handler is not configured\\. Please set it in general_settings\\.","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"enterprise/litellm_enterprise/proxy/auth/custom_sso_handler.py","lineNumber":68,"sourceCode":"        \"\"\"\n        from fastapi_sso.sso.base import OpenID\n\n        from litellm.integrations.custom_sso_handler import CustomSSOLoginHandler\n        from litellm.proxy.proxy_server import (\n            CommonProxyErrors,\n            general_settings,\n            premium_user,\n            user_custom_ui_sso_sign_in_handler,\n        )\n        from litellm.proxy.auth.trusted_proxy_utils import (\n            require_trusted_proxy_request,\n        )\n\n        if premium_user is not True:\n            raise ValueError(CommonProxyErrors.not_premium_user.value)\n\n        if user_custom_ui_sso_sign_in_handler is None:\n            raise ValueError(\n                \"custom_ui_sso_sign_in_handler is not configured. Please set it in general_settings.\"\n            )\n\n        require_trusted_proxy_request(\n            request=request,\n            general_settings=general_settings,\n            feature_name=\"Custom UI SSO\",\n        )\n\n        custom_sso_login_handler = cast(\n            CustomSSOLoginHandler, user_custom_ui_sso_sign_in_handler\n        )\n        openid_response: OpenID = (\n            await custom_sso_login_handler.handle_custom_ui_sso_sign_in(\n                request=request,\n            )\n        )\n","sourceCodeStart":50,"sourceCodeEnd":86,"githubUrl":"https://github.com/BerriAI/litellm/blob/6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d/enterprise/litellm_enterprise/proxy/auth/custom_sso_handler.py#L50-L86","documentation":"ValueError from the enterprise custom SSO path: premium check passed, but user_custom_ui_sso_sign_in_handler (imported from litellm.proxy.proxy_server) is None. The proxy did not load a custom_ui_sso_sign_in_handler from general_settings, so there is nothing to delegate the sign-in to.","triggerScenarios":"Hitting the custom UI SSO sign-in endpoint while general_settings lacks custom_ui_sso_sign_in_handler, or the configured module path failed to import at startup (silently leaving the module-level variable None).","commonSituations":"Typo in the handler's dotted module path in the config; the handler file not on PYTHONPATH inside the Docker image; config updated but proxy not restarted; the module raised during import and the error was only visible deep in startup logs.","solutions":["Add custom_ui_sso_sign_in_handler: <module.path:function> under general_settings and restart the proxy","Verify the module imports cleanly: python -c 'import my_module; my_module.handler' inside the proxy's environment/container","Check startup logs for import errors around general_settings customization loading; fix PYTHONPATH or packaging so the handler resolves"],"exampleFix":"# before\ngeneral_settings:\n  master_key: sk-123\n  # custom_ui_sso_sign_in_handler missing\n\n# after\ngeneral_settings:\n  master_key: sk-123\n  custom_ui_sso_sign_in_handler: enterprise_sso.custom_sign_in:handler","handlingStrategy":"validation","validationCode":"# at startup, prove the handler loads in the proxy's env\nimport importlib\nmod, fn = 'enterprise_sso.custom_sign_in', 'handler'\nobj = getattr(importlib.import_module(mod), fn)\nassert callable(obj)","typeGuard":null,"tryCatchPattern":"try:\n    httpx.get(f'{PROXY_URL}/ui/sso/sign-in')\nexcept ValueError as e:\n    if 'custom_ui_sso_sign_in_handler is not configured' in str(e):\n        fix_config('add custom_ui_sso_sign_in_handler to general_settings')\n    raise","preventionTips":["Smoke-test handler import inside the actual container image","Pin the handler module in the image (not a bind mount) to avoid path drift","Restart the proxy after every general_settings change"],"tags":["sso","auth","configuration","litellm-enterprise"],"backgroundTag":null,"analyzedSha":"6c2dcb801bf2b75c18f1bb24140e7cf57465cc4d","analyzedAt":"2026-08-15T07:12:03.035Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}