Errors / Gateway Token Missing
Fix: Gateway Token Missing
Error: "unauthorized: gateway token missing" or "websocket: authentication required"
What It Means
Your WebChat or dashboard can't connect to the OpenClaw gateway because it's not passing the authentication token correctly. Think of it like showing up to a building with an ID badge that doesn't match the security system — you're not getting in.
Common Causes
- •You set up
gateway.auth.tokenbut forgot to addgateway.remote.token - •The tokens don't match exactly (even a single character difference will fail)
- •You changed your auth token but didn't update the remote token
- •Using WebChat without passing the token in the URL
Ask Your Agent to Fix This
Copy this prompt and send it to your OpenClaw agent. It will check your config and fix the token mismatch:
Check my OpenClaw config (~/.openclaw/openclaw.json) and make sure
the gateway.remote.token matches gateway.auth.token. If they don't
match, update the remote.token to match auth.token, then tell me
what you changed.
Fix It Manually
Open your config and make sure both tokens match:
{
"gateway": {
"remote": {
"token": "YOUR_AUTH_TOKEN"
},
"auth": {
"token": "YOUR_AUTH_TOKEN"
}
}
}Note: The values must be identical. Many people set auth.token but forget remote.token.
Verify the Fix
After fixing, check your gateway status:
openclaw gateway status
Or try connecting to WebChat again. If using the URL method, make sure to include the token:
http://127.0.0.1:18789?token=YOUR_AUTH_TOKEN
How to Prevent This
- ✓Set both tokens at the same time when configuring
- ✓Run
openclaw security auditafter any config changes - ✓Use the CLI (
openclaw chat) instead of WebChat to avoid token URL issues
Related Errors
Related Guides
Still having trouble?
Ask on Discord