{"record":{"id":"0cff947db309b737","repo":"BerriAI/litellm","slug":"return-to-does-not-match-the-configured-control-pl","errorCode":null,"errorMessage":"return_to does not match the configured control_plane_url","messagePattern":"return_to does not match the configured control_plane_url","errorType":"http","errorClass":"HTTPException","httpStatus":400,"severity":"error","filePath":"litellm/proxy/management_endpoints/ui_sso.py","lineNumber":2839,"sourceCode":"        Returns False if control_plane_url is not configured (return_to is ignored).\n        Raises HTTPException(400) if return_to origin does not match control_plane_url origin.\n        \"\"\"\n        from litellm.proxy.proxy_server import general_settings\n\n        control_plane_url: Final = general_settings.get(\"control_plane_url\")\n        if control_plane_url is None:\n            return False\n\n        def _origin(url: str) -> tuple:\n            parsed: Final = urlparse(url)\n            scheme: Final = (parsed.scheme or \"\").lower()\n            hostname: Final = (parsed.hostname or \"\").lower()\n            default_port: Final = 443 if scheme == \"https\" else 80\n            port: Final = parsed.port if parsed.port is not None else default_port\n            return (scheme, hostname, port)\n\n        if _origin(return_to) != _origin(control_plane_url):\n            raise HTTPException(\n                status_code=400,\n                detail=\"return_to does not match the configured control_plane_url\",\n            )\n\n        return True\n\n    @staticmethod\n    async def get_sso_login_redirect(\n        redirect_url: str,\n        google_client_id: str | None = None,\n        microsoft_client_id: str | None = None,\n        generic_client_id: str | None = None,\n        state: str | None = None,\n        request: Request | None = None,\n    ) -> RedirectResponse | None:\n        \"\"\"\n        Step 1. Call Get Login Redirect for the SSO provider. Send the redirect response to `redirect_url`\n","sourceCodeStart":2821,"sourceCodeEnd":2857,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/ui_sso.py#L2821-L2857","documentation":"Error \"return_to does not match the configured control_plane_url\" thrown in BerriAI/litellm.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/ui_sso.py:2839 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a return_to URL that matches the configured control_plane_url, or fix the control_plane_url setting."],"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"}