# rpc error: code = Unauthenticated desc = missing or invalid authentication token

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

## Root Cause

The gRPC client did not provide a valid authentication token, or the token has expired/was rejected by the server's interceptor.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.22 | active | — | — |
| 1.23 | active | — | — |

## Workarounds

1. **Obtain a valid token from the auth service and pass it in metadata.** (95% success)
   ```
   token := getAuthToken()
md := metadata.Pairs("authorization", "Bearer "+token)
ctx := metadata.NewOutgoingContext(context.Background(), md)
resp, err := client.SomeRPC(ctx, req)
   ```
2. **Use a per-RPC credential with grpc.WithPerRPCCredentials.** (90% success)
   ```
   conn, _ := grpc.Dial(target, grpc.WithPerRPCCredentials(oauth.NewTokenSource(tokenSource)))
   ```

## Dead Ends

- **Hardcoding a static token that is expired.** — Server rejects expired tokens; need a fresh one. (90% fail)
- **Omitting the token entirely.** — Server requires authentication; missing token always fails. (100% fail)
