BerriAI/litellm · error · ProxyException

MICROSOFT_CLIENT_SECRET not set. Set it in .env file

Error message

MICROSOFT_CLIENT_SECRET not set. Set it in .env file

What it means

Error "MICROSOFT_CLIENT_SECRET not set. Set it in .env file" thrown in BerriAI/litellm.

Source

Thrown at litellm/proxy/management_endpoints/ui_sso.py:2898

                )
            google_sso: Final = GoogleSSO(
                client_id=google_client_id,
                client_secret=google_client_secret,
                redirect_uri=redirect_url,
            )
            verbose_proxy_logger.info(
                "In /google-login/key/generate, \nGOOGLE_REDIRECT_URI: %s\nGOOGLE_CLIENT_ID: %s",
                redirect_url,
                google_client_id,
            )
            with google_sso:
                return await google_sso.get_login_redirect(state=state)
        # Microsoft SSO Auth
        elif microsoft_client_id is not None:
            microsoft_client_secret: Final = os.getenv("MICROSOFT_CLIENT_SECRET", None)
            microsoft_tenant: Final = os.getenv("MICROSOFT_TENANT", None)
            if microsoft_client_secret is None:
                raise ProxyException(
                    message="MICROSOFT_CLIENT_SECRET not set. Set it in .env file",
                    type=ProxyErrorTypes.auth_error,
                    param="MICROSOFT_CLIENT_SECRET",
                    code=status.HTTP_500_INTERNAL_SERVER_ERROR,
                )
            microsoft_sso: Final = CustomMicrosoftSSO(
                client_id=microsoft_client_id,
                client_secret=microsoft_client_secret,
                tenant=microsoft_tenant,
                redirect_uri=redirect_url,
                allow_insecure_http=True,
            )
            with microsoft_sso:
                return await microsoft_sso.get_login_redirect(state=state)
        elif generic_client_id is not None:
            from fastapi_sso.sso.base import DiscoveryDocument
            from fastapi_sso.sso.generic import create_provider

View on GitHub (pinned to 77b7c6c40c)

Solutions

  1. Set MICROSOFT_CLIENT_SECRET in the .env file and restart the proxy.

When it happens

Trigger: Thrown at litellm/proxy/management_endpoints/ui_sso.py:2898 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of BerriAI/litellm@77b7c6c40c (2026-08-18). Data as JSON: /api/errors/e36fec847d71219a. Report an issue: GitHub.