{"record":{"id":"ef60ce42010f0579","repo":"BerriAI/litellm","slug":"microsoft-client-secret","errorCode":"MICROSOFT_CLIENT_SECRET","errorMessage":"MICROSOFT_CLIENT_SECRET not set. Set it in .env file","messagePattern":"MICROSOFT_CLIENT_SECRET not set\\. Set it in \\.env file","errorType":"exception","errorClass":"ProxyException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":4204,"sourceCode":"        return f\"{MicrosoftSSOHandler.get_graph_api_base_url()}/me/memberOf\"\n\n    @staticmethod\n    async def get_microsoft_callback_response(\n        request: Request,\n        microsoft_client_id: str,\n        redirect_url: str,\n        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,","sourceCodeStart":4186,"sourceCodeEnd":4222,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L4186-L4222","documentation":"ProxyException raised in the Microsoft SSO callback: the MICROSOFT_CLIENT_SECRET environment variable is not set, so the OAuth code exchange with Microsoft cannot be signed. It is a proxy configuration error — the admin must add the secret to .env before Microsoft login can work.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:4204 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set MICROSOFT_CLIENT_SECRET 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-14T00:17:10.932Z"}