# rpc error: code = Unauthenticated desc = missing authorization metadata

- **ID:** `go/grpc-unauthenticated-missing-metadata`
- **Domain:** go
- **Category:** auth_error
- **Verification:** ai_generated
- **Fix Rate:** 80%

## Root Cause

The server's auth interceptor requires an authorization token in incoming metadata, but the client did not attach one (or attached it under the wrong key).

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.0+ | active | — | — |

## Workarounds

1. **** (93% success)
   ```
   md := metadata.Pairs("authorization", "Bearer "+token)
ctx := metadata.NewOutgoingContext(ctx, md)
resp, err := client.Get(ctx, req)
   ```
2. **** (90% success)
   ```
   func authUnary(ctx context.Context, method string, req, reply interface{}, cc *grpc.ClientConn, inv grpc.UnaryInvoker, opts ...grpc.CallOption) error {
  ctx = metadata.AppendToOutgoingContext(ctx, "authorization", "Bearer "+getToken())
  return inv(ctx, method, req, reply, cc, opts...)
}
   ```

## Dead Ends

- **** — Disables authentication entirely, exposing protected endpoints (90% fail)
- **** — May still fail if the interceptor expects a specific metadata key like "authorization" with a "Bearer " prefix (60% fail)
