{"record":{"id":"7f254001b4cbff71","repo":"HKUDS/nanobot","slug":"empty-bearer-token","errorCode":null,"errorMessage":"empty bearer token","messagePattern":"empty bearer token","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"nanobot/channels/msteams/runtime.py","lineNumber":482,"sourceCode":"        quoted = quoted.strip()\n        reply = reply.strip()\n        if quoted and reply:\n            return f\"User is replying to: {quoted}\\nUser reply: {reply}\"\n        if reply:\n            return reply\n        return quoted\n\n    async def _validate_inbound_auth(self, auth_header: str, activity: dict[str, Any]) -> None:\n        \"\"\"Validate inbound Bot Framework bearer token.\"\"\"\n        if not MSTEAMS_AVAILABLE:\n            raise RuntimeError(\"PyJWT not installed. Run: nanobot plugins enable msteams\")\n\n        if not auth_header.lower().startswith(\"bearer \"):\n            raise ValueError(\"missing bearer token\")\n\n        token = auth_header.split(\" \", 1)[1].strip()\n        if not token:\n            raise ValueError(\"empty bearer token\")\n\n        header = jwt.get_unverified_header(token)\n        kid = str(header.get(\"kid\") or \"\").strip()\n        if not kid:\n            raise ValueError(\"missing token kid\")\n\n        jwks = await self._get_botframework_jwks()\n        keys = cast(list[dict[str, Any]], jwks.get(\"keys\") or [])\n        jwk = next((key for key in keys if key.get(\"kid\") == kid), None)\n        if not jwk:\n            raise ValueError(f\"signing key not found for kid={kid}\")\n\n        public_key = RSAAlgorithm.from_jwk(json.dumps(jwk))\n        claims = jwt.decode(\n            token,\n            key=cast(Any, public_key),\n            algorithms=[\"RS256\"],\n            audience=self.config.app_id,","sourceCodeStart":464,"sourceCodeEnd":500,"githubUrl":"https://github.com/HKUDS/nanobot/blob/42f37dc4c0e409eac7818a82d165c5f2757bc075/nanobot/channels/msteams/runtime.py#L464-L500","documentation":"Error \"empty bearer token\" thrown in HKUDS/nanobot.","triggerScenarios":"Thrown at nanobot/channels/msteams/runtime.py:482 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":"42f37dc4c0e409eac7818a82d165c5f2757bc075","analyzedAt":"2026-08-26T00:18:52.276Z","schemaVersion":2},"datasetVersion":"2026-08-26T04:18:47.238Z"}