{"record":{"id":"3a9678739d99dd16","repo":"BerriAI/litellm","slug":"saml-assertion-is-missing-the-required-id-attribut","errorCode":null,"errorMessage":"SAML assertion is missing the required ID attribute.","messagePattern":"SAML assertion is missing the required ID attribute\\.","errorType":"http","errorClass":"HTTPException","httpStatus":401,"severity":"error","filePath":"litellm/proxy/management_endpoints/sso/saml_sso.py","lineNumber":400,"sourceCode":"                detail=\"SAML response is not bound to this browser's login request.\",\n            )\n        elif not SAMLAuthHandler._bool_env(\"SAML_ALLOW_UNSOLICITED\", False):\n            raise HTTPException(\n                status_code=status.HTTP_401_UNAUTHORIZED,\n                detail=\"Unsolicited (IdP-initiated) SAML responses are disabled.\",\n            )\n        elif cache.redis_cache is None:\n            raise HTTPException(\n                status_code=status.HTTP_401_UNAUTHORIZED,\n                detail=(\n                    \"Unsolicited (IdP-initiated) SAML responses require a shared Redis cache \"\n                    \"so the replay guard is enforced across every worker.\"\n                ),\n            )\n\n        assertion_id: Final = cast(str | None, auth.get_last_assertion_id())  # cast-ok: untyped python3-saml\n        if assertion_id is None:\n            raise HTTPException(\n                status_code=status.HTTP_401_UNAUTHORIZED,\n                detail=\"SAML assertion is missing the required ID attribute.\",\n            )\n        consumed_key: Final = f\"{_SAML_CONSUMED_ASSERTION_CACHE_PREFIX}:{assertion_id}\"\n        consumed_count: Final = await cache.async_increment_cache(\n            key=consumed_key, value=1, ttl=SAMLAuthHandler._replay_guard_ttl(auth)\n        )\n        if consumed_count is not None and consumed_count > 1:\n            raise HTTPException(\n                status_code=status.HTTP_401_UNAUTHORIZED,\n                detail=\"SAML assertion has already been used (replay detected).\",\n            )\n\n    @staticmethod\n    def _result_from_auth(auth: \"OneLogin_Saml2_Auth\") -> CustomOpenID:\n        attributes: Final = cast(dict[str, list[str]], auth.get_attributes())  # cast-ok: untyped python3-saml\n        name_id: Final = cast(str | None, auth.get_nameid())  # cast-ok: untyped python3-saml\n","sourceCodeStart":382,"sourceCodeEnd":418,"githubUrl":"https://github.com/BerriAI/litellm/blob/77b7c6c40c0c5aa5fbcb1d6a1825ac39ca8829b8/litellm/proxy/management_endpoints/sso/saml_sso.py#L382-L418","documentation":"After processing, auth.get_last_assertion_id() returns None: the assertion carries no ID attribute, which the replay guard requires to track consumption. The response is rejected with 401 because replay protection is impossible without an assertion id.","triggerScenarios":"Thrown at litellm/proxy/management_endpoints/sso/saml_sso.py:400 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Configure the IdP to include an ID attribute in the assertion."],"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"}