#The Mac App keeps failing becouse theres no token, but theres no where to enter it
1 messages · Page 1 of 1 (latest)
That âtokenâ is almost always the Gateway auth token (not an LLM API key), and you do enter it â just not in a popup.
Where to put the token
- Open the Control UI in a browser (on the same machine as the Gateway):
http://127.0.0.1:18789/
- Open the Settings panel in the Control UI and paste the token there.
The UI stores it asconnect.params.auth.token.
Docs: https://docs.openclaw.ai/web/control-ui
How to get the token
On the Gateway host, run:
openclaw dashboard
and open the link it prints (it includes ?token=... and will âseedâ the UI with the token).
Docs: https://docs.openclaw.ai/help/faq#how-do-i-authenticate-the-dashboard-token-on-localhost-vs-remote
If the error is actually âpairing requiredâ (code 1008)
Thatâs a different issue: you must approve the device once:
openclaw devices list
openclaw devices approve <requestId>
Quick questions so I can point you to the exact fix
- Whatâs the exact error text the Mac app shows? (screenshot is fine)
- Is your Gateway local (same Mac) or remote (VPS/Tailscale)?
- What does
openclaw --versionsay?
(Also: donât paste the token itself into Discordâtreat it like a password.)
No the Gateway/Node is on another Computer. The error im getting is Gatewav error: gatewav connect: connect to gatewav @ ws:127.0.0.1:18789: unauthorzed: datewav token missina brovide
Gateway error: gateway connect: connect to gateway @ ws://127.0.0.1:18789: unauthorized: gateway token missing (provide
gateway auth token) but the gate way is set as jacojac@10.0.0.91
Thatâs actually expected in Remote over SSH mode.
Even though your Gateway is on jacojac@10.0.0.91, the macOS app creates an SSH tunnel and then talks to the remote Gateway as if it were local, so it connects to:
ws://127.0.0.1:18789â (this is the tunneled port)
So the real problem is the rest of the error:
unauthorized: gateway token missing (provide gateway auth token)
Fix: paste the Gateway auth token into the Control UI / Web Chat settings
- On the Gateway host (
10.0.0.91), run:
openclaw dashboard
This prints a tokenized link (.../?token=...). Copy the token (donât paste it into Discord).
- On your Mac, in the Web Chat / Control UI (inside the app, or in a browser if you open it), open the settings/gear and paste the token (itâs stored as
connect.params.auth.token).
Docs:
If you donât know the token / never got one
On the Gateway host you can generate one:
openclaw doctor --generate-gateway-token
(Then you must paste the new token into the UI/app settings.)
If you tell me whether your mac app is set to Remote over SSH or Remote direct (ws/wss), I can tell you exactly where that token field is in that mode.
Remote over SSH
Yep â Remote over SSH is why youâre seeing ws://127.0.0.1:18789.
In that mode the Mac app makes an SSH tunnel and then connects to the remote gateway through localhost. So 127.0.0.1:18789 is correct â you just need to give the UI/app the gateway auth token.
The easiest way (works even if you canât find a token field in the app)
- On the gateway computer (10.0.0.91), run:
openclaw dashboard
-
It prints a URL like:
http://127.0.0.1:18789/?token=... -
Copy that full URL and open it on your Mac in a browser while the macOS app remote SSH tunnel is active (hit âTest remoteâ once, or open Web Chat so it brings the tunnel up).
That page will store the token, and then the Mac app / Control UI should stop saying âgateway token missingâ.
If you do want to enter it manually
Open the Control UI (on your Mac, with the tunnel active):
http://127.0.0.1:18789/
Then open the Settings / connection settings panel in the UI and paste the token there (itâs stored asconnect.params.auth.token).
Docs: https://docs.openclaw.ai/web/control-ui
If openclaw dashboard doesnât work / you never had a token
On the gateway computer:
openclaw doctor --generate-gateway-token
Then repeat the openclaw dashboard step.
If you tell me what you see in the macOS app when you open Web Chat (screenshot ok, donât include the token), I can point to the exact button/field.
Still not working
jacojac@openclaw.local
{
"gateway" : {
"mode" : "remote",
"remote" : {
"sshIdentity" : "/Users/jacojac/.ssh/id_ed25519",
"sshTarget" : "jacojac@openclaw.local",
"url" : "ws://openclaw.local:18789"
}
}
}
In Remote over SSH, opening the ...?token=... link in Safari usually wonât help, because the Mac appâs embedded WebChat is its own WebView storage (it doesnât share Safariâs localStorage). So the app still has âno tokenâ.
What the macOS app actually uses in Remote mode is your Macâs config key:
gateway.remote.tokenâ (not the remote machineâsgateway.remote.*)
Fix (on the Mac running OpenClaw.app)
In Terminal on your Mac:
openclaw config set gateway.mode "remote"
openclaw config set gateway.remote.url "ws://127.0.0.1:18789"
openclaw config set gateway.remote.token "<PASTE YOUR REMOTE GATEWAY AUTH TOKEN HERE>"
That token value must equal the remote gatewayâs gateway.auth.token (on 10.0.0.91).
The CLI isnt installed
Then quit and re-open the macOS app (or at least close/reopen WebChat) and try again.
Docs for the config flow: https://docs.openclaw.ai/gateway/remote#cli-remote-defaults
If it still says token missing
Two quick checks (donât paste the token, just say whether itâs set):
- On your Mac:
openclaw config get gateway.remote.url
openclaw config get gateway.remote.token
- Also confirm nothing local is already using the tunnel port:
lsof -nP -iTCP:18789 -sTCP:LISTEN
jacojac@openclaw.local is just your SSH target â that part is fine if openclaw.local resolves to the gateway box.
The reason youâre still getting âgateway token missingâ is usually one of these two things:
1) The Mac app has no token to send (Remote over SSH reads it from config/env)
In Remote over SSH, there currently isnât a âtokenâ field in Settings â General. The app reads the token from your Macâs config:
gateway.remote.token(or envOPENCLAW_GATEWAY_TOKEN)
So set it on the Mac running OpenClaw.app (not on the remote host):
Option A (Terminal on your Mac)
openclaw config set gateway.mode "remote"
openclaw config set gateway.remote.url "ws://127.0.0.1:18789"
openclaw config set gateway.remote.token "<REMOTE GATEWAY'S gateway.auth.token>"
Post the outputs (redact token), and Iâll tell you whatâs wrong next.
Option B (no CLI)
Open OpenClaw.app â Settings â Config tab â find gateway â remote â token and paste it there â Save â quit & relaunch the app.
Important: the value you paste must be the remote machineâs gateway.auth.token (the gatewayâs auth), not something like an SSH password.
2) Port 18789 is already in use on your Mac, so the SSH tunnel canât bind (and you end up talking to the wrong gateway)
Remote over SSH always wants to use localhost:18789 for the tunnel. If you still have a local gateway running on your Mac, the tunnel canât claim that port.
On your Mac run:
lsof -nP -iTCP:18789 -sTCP:LISTEN
If that shows an openclaw process listening, stop the local gateway (or switch fully to remote mode and quit/restart).
Quick sanity check on the SSH target
From your Mac:
Your config is missing the one field the Mac app needs in Remote over SSH:
gateway.remote.token
Right now it has sshTarget/sshIdentity/url, but no token, so the app connects to the SSH-forwarded ws://127.0.0.1:18789 and the gateway replies: âunauthorized: gateway token missingâ.
What to do
1) On the gateway machine (10.0.0.91)
Get (or generate) the gateway auth token:
openclaw config get gateway.auth.token
# or, if empty/missing:
openclaw doctor --generate-gateway-token
openclaw config get gateway.auth.token
ping -c 1 openclaw.local
Make sure it resolves to 10.0.0.91 (or just use jacojac@10.0.0.91 to remove any DNS weirdness).
If you paste:
- the output of
lsof ...(safe) - and what the app shows under âTest remoteâ (screenshot ok; donât include the token)
âŠI can tell which of the two it is.
(Do not paste the token into Discord.)
2) On your Mac (the OpenClaw.app machine)
Set that token as the remote token:
openclaw config set gateway.remote.token "<PASTE_TOKEN_FROM_GATEWAY_HOST>"
Then fully quit OpenClaw.app and reopen it, hit Test remote again.
3) Optional cleanup (recommended)
Since youâre using SSH tunneling, set remote URL to the tunneled address so CLI/app expectations match:
openclaw config set gateway.remote.url "ws://127.0.0.1:18789"
zsh: command not found: openclaw
Your JSON should end up like this (example)
{
"gateway": {
"mode": "remote",
"remote": {
"sshIdentity": "/Users/jacojac/.ssh/id_ed25519",
"sshTarget": "jacojac@openclaw.local",
"url": "ws://127.0.0.1:18789",
"token": "âŠ"
}
}
}
If it still fails after that: paste the output of openclaw config get gateway.remote.token (just say âsetâ/âemptyâ, donât include it) + whatever Test remote prints.
You donât need the CLI for this part.
In Remote over SSH, the Mac app reads the gateway auth token from your local config file on the Mac:
~/.openclaw/openclaw.json â gateway.remote.token
Right now your config has sshTarget/sshIdentity/url but no token, so the app canât authenticate and you get âgateway token missingâ.
Do this (no CLI required)
1) Get the token from the gateway computer (10.0.0.91)
On that computer, open this file:
~/.openclaw/openclaw.json
Look for:
You can fix this without the CLI â the Mac app just reads gateway.remote.token from your config file.
Right now your config has no token, so the app literally has nothing to send â âgateway token missingâ.
1) Get the token from the gateway computer (openclaw.local)
SSH in and open the gatewayâs config file:
ssh jacojac@openclaw.local 'cat ~/.openclaw/openclaw.json'
Look for:
gateway.auth.tokenâ copy that value (donât paste it into Discord)
If you donât see gateway.auth.token in that file, the gateway might be getting it from an env var (OPENCLAW_GATEWAY_TOKEN) or itâs not configured (then youâll need to set/generate one on the gateway host).
2) Paste it into your Macâs config (this is what the app uses)
On your Mac, edit:
~/.openclaw/openclaw.json
Add one line:
"token": "PASTE_THE_GATEWAY_AUTH_TOKEN_HERE"
âŠinside gateway.remote, so it becomes:
{
"gateway": {
"mode": "remote",
"remote": {
"sshIdentity": "/Users/jacojac/.ssh/id_ed25519",
"sshTarget": "jacojac@openclaw.local",
"url": "ws://openclaw.local:18789",
"token": "PASTE_HERE"
}
}
}
Easiest way to edit (no openclaw needed):
nano ~/.openclaw/openclaw.json
3) Fully quit + reopen OpenClaw.app, then âTest remoteâ again
If after adding the token it still fails, tell me what the error changes to (usually it flips from âtoken missingâ to ârejected tokenâ or a tunnel/port issue), and weâll do the next step.
gateway: {
auth: { token: "..." }
}
That gateway.auth.token value is what you need. (Donât paste it into Discord.)
2) Paste it into your Macâs config
On your Mac, open:
~/.openclaw/openclaw.json
âŠand add a token inside gateway.remote:
{
"gateway": {
"mode": "remote",
"remote": {
"sshIdentity": "/Users/jacojac/.ssh/id_ed25519",
"sshTarget": "jacojac@openclaw.local",
"url": "ws://openclaw.local:18789",
"token": "PASTE_THE_REMOTE_gateway.auth.token_HERE"
}
}
}
You can edit it via:
- Finder â Go â Go to Folder⊠â paste
~/.openclaw/â openopenclaw.jsonin TextEdit, or - OpenClaw.app â Settings â Config (if you have that tab) and edit the raw JSON there.