{"record":{"id":"923735bd097648b2","repo":"langchain-ai/langgraph","slug":"authentication-handler-already-set-as-self-authe","errorCode":null,"errorMessage":"Authentication handler already set as {self._authenticate_handler}.","messagePattern":"Authentication handler already set as (.+?)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"libs/sdk-py/langgraph_sdk/auth/__init__.py","lineNumber":297,"sourceCode":"\n            ```python\n            @auth.authenticate\n            async def authenticate(\n                method: str,\n                path: str,\n                headers: dict[str, bytes]\n            ) -> Auth.types.MinimalUserDict:\n                permissions, user = await verify_request(method, path, headers)\n                # Permissions could be things like [\"runs:read\", \"runs:write\", \"threads:read\", \"threads:write\"]\n                return {\n                    \"identity\": user[\"id\"],\n                    \"permissions\": permissions,\n                    \"display_name\": user[\"name\"],\n                }\n            ```\n        \"\"\"\n        if self._authenticate_handler is not None:\n            raise ValueError(\n                f\"Authentication handler already set as {self._authenticate_handler}.\"\n            )\n        self._authenticate_handler = fn\n        return fn\n\n\n## Helper types & utilities\n\nV = typing.TypeVar(\"V\", contravariant=True)\n\n\nclass _ActionHandler(typing.Protocol[V]):\n    async def __call__(\n        self, *, ctx: types.AuthContext, value: V\n    ) -> types.HandlerResult: ...\n\n\nT = typing.TypeVar(\"T\", covariant=True)","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/langchain-ai/langgraph/blob/38031739e551638e373fb553453256c23feeb41f/libs/sdk-py/langgraph_sdk/auth/__init__.py#L279-L315","documentation":"Error \"Authentication handler already set as {self._authenticate_handler}.\" thrown in langchain-ai/langgraph.","triggerScenarios":"Thrown at libs/sdk-py/langgraph_sdk/auth/__init__.py:297 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"38031739e551638e373fb553453256c23feeb41f","analyzedAt":"2026-08-26T18:02:49.312Z","schemaVersion":2},"datasetVersion":"2026-08-26T21:11:00.512Z"}