{"record":{"id":"e36fec847d71219a","repo":"BerriAI/litellm","slug":"microsoft-client-secret-not-set-set-it-in-env-fi","errorCode":null,"errorMessage":"MICROSOFT_CLIENT_SECRET not set. Set it in .env file","messagePattern":"MICROSOFT_CLIENT_SECRET not set\\. Set it in \\.env file","errorType":"http","errorClass":"ProxyException","httpStatus":500,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":2898,"sourceCode":"                )\n            google_sso: Final = GoogleSSO(\n                client_id=google_client_id,\n                client_secret=google_client_secret,\n                redirect_uri=redirect_url,\n            )\n            verbose_proxy_logger.info(\n                \"In /google-login/key/generate, \\nGOOGLE_REDIRECT_URI: %s\\nGOOGLE_CLIENT_ID: %s\",\n                redirect_url,\n                google_client_id,\n            )\n            with google_sso:\n                return await google_sso.get_login_redirect(state=state)\n        # Microsoft SSO Auth\n        elif microsoft_client_id is not None:\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            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            with microsoft_sso:\n                return await microsoft_sso.get_login_redirect(state=state)\n        elif generic_client_id is not None:\n            from fastapi_sso.sso.base import DiscoveryDocument\n            from fastapi_sso.sso.generic import create_provider\n","sourceCodeStart":2880,"sourceCodeEnd":2916,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L2880-L2916","documentation":"Error \"MICROSOFT_CLIENT_SECRET not set. Set it in .env file\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:2898 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":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-14T00:17:10.932Z"}