{"record":{"id":"cb29672d3c0f17f3","repo":"BerriAI/litellm","slug":"microsoft-tenant","errorCode":"MICROSOFT_TENANT","errorMessage":"MICROSOFT_TENANT not set. Set it in .env file","messagePattern":"MICROSOFT_TENANT not set\\. Set it in \\.env file","errorType":"exception","errorClass":"ProxyException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":4211,"sourceCode":"        return_raw_sso_response: bool = False,\n    ) -> CustomOpenID | OpenID | dict:\n        \"\"\"\n        Get the Microsoft SSO callback response\n\n        Args:\n            return_raw_sso_response: If True, return the raw SSO response\n        \"\"\"\n        microsoft_client_secret: Final = os.getenv(\"MICROSOFT_CLIENT_SECRET\", None)\n        microsoft_tenant: Final = os.getenv(\"MICROSOFT_TENANT\", None)\n        if microsoft_client_secret is None:\n            raise ProxyException(\n                message=\"MICROSOFT_CLIENT_SECRET not set. Set it in .env file\",\n                type=ProxyErrorTypes.auth_error,\n                param=\"MICROSOFT_CLIENT_SECRET\",\n                code=status.HTTP_500_INTERNAL_SERVER_ERROR,\n            )\n        if microsoft_tenant is None:\n            raise ProxyException(\n                message=\"MICROSOFT_TENANT not set. Set it in .env file\",\n                type=ProxyErrorTypes.auth_error,\n                param=\"MICROSOFT_TENANT\",\n                code=status.HTTP_500_INTERNAL_SERVER_ERROR,\n            )\n        microsoft_sso: Final = CustomMicrosoftSSO(\n            client_id=microsoft_client_id,\n            client_secret=microsoft_client_secret,\n            tenant=microsoft_tenant,\n            redirect_uri=redirect_url,\n            allow_insecure_http=True,\n        )\n        original_msft_result: Final = (\n            await microsoft_sso.verify_and_process(\n                request=request,\n                convert_response=False,\n            )\n            or {}","sourceCodeStart":4193,"sourceCodeEnd":4229,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L4193-L4229","documentation":"ProxyException raised in the Microsoft SSO callback: MICROSOFT_TENANT is not set in the environment, so the Microsoft auth/tenant-scoped endpoints cannot be constructed. A proxy configuration error requiring the tenant to be added to .env.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:4211 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set MICROSOFT_TENANT in the .env file and restart the proxy."],"exampleFix":null,"handlingStrategy":"validation","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"}