← Back to library

Reddit 实战:Headless VM 上 GOG OAuth 回调 127.0.0.1 失败排障

场景:OpenClaw 跑在无图形界面的远程 VM,OAuth 回调落到本地环回地址导致授权流程卡死。可通过重定向策略与设备授权替代路径降低失败率。

REDDITDiscovered 2026-02-14Author u/heydouglas
Prerequisites
  • You are using Google OAuth integration from a headless Linux VM environment.
  • Google Cloud OAuth client settings are editable (redirect URI / app type).
Steps
  1. Confirm which OAuth app type you created and whether callback currently points to localhost loopback.
  2. For remote/headless deployment, switch to a supported redirect strategy (public callback endpoint or device flow where available).
  3. Re-run authorization from a machine that can complete browser interaction, then persist refreshed credentials to the VM runtime.
  4. Validate integration with a read-only API call before enabling write actions.
Commands
openclaw gateway status
openclaw logs --local-time
openclaw gateway restart
Verify

OAuth completes without localhost callback dead-end, and subsequent integration calls succeed across gateway restart.

Caveats
  • Avoid storing OAuth tokens in plaintext logs or shell history.
  • Provider-specific headless OAuth support differs by app type and policy(需验证).
Source attribution

This tip is aggregated from community/public sources and preserved with attribution.

Open original source ↗
Visit original post