{
  "id": "go/grpc-unauthenticated-missing-token",
  "signature": "rpc error: code = Unauthenticated desc = missing or invalid authentication token",
  "signature_zh": "rpc错误：代码=未认证 描述=缺少或无效的身份验证令牌",
  "regex": "rpc\\ error:\\ code\\ =\\ Unauthenticated\\ desc\\ =\\ missing\\ or\\ invalid\\ authentication\\ token",
  "domain": "go",
  "category": "auth_error",
  "subcategory": null,
  "root_cause": "The gRPC client did not provide a valid authentication token, or the token has expired/was rejected by the server's interceptor.",
  "root_cause_type": "generic",
  "root_cause_zh": "gRPC客户端未提供有效的身份验证令牌，或令牌已过期/被服务器的拦截器拒绝。",
  "versions": [
    {
      "version": "1.22",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.23",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Hardcoding a static token that is expired.",
      "why_fails": "Server rejects expired tokens; need a fresh one.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    },
    {
      "action": "Omitting the token entirely.",
      "why_fails": "Server requires authentication; missing token always fails.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Obtain a valid token from the auth service and pass it in metadata.",
      "success_rate": 0.95,
      "how": "token := getAuthToken()\nmd := metadata.Pairs(\"authorization\", \"Bearer \"+token)\nctx := metadata.NewOutgoingContext(context.Background(), md)\nresp, err := client.SomeRPC(ctx, req)",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use a per-RPC credential with grpc.WithPerRPCCredentials.",
      "success_rate": 0.9,
      "how": "conn, _ := grpc.Dial(target, grpc.WithPerRPCCredentials(oauth.NewTokenSource(tokenSource)))",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2024-05-05",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}