Skip to content

feature: Add new functionality to connect options #766

Closed as not planned
Closed as not planned

Description

@xrow

I can`t use the direct connect option to connect to my instance. I do not want a local setup. I do not have SSH available, because I am behind a layer 7 LB.

I need either the option to auth via oauth2 since I have a oauth2-proxy infront or I need to add a script like

kubectl port-forward --address 127.0.0.1 -n openclaw deployment/openclaw 18789:18790

to run before the connection starts. Maybe a stop script is needed too. Is it powershell? Maybe. Or do we just point to some file?

Activity

  1. clawsweeper commented on Jun 15, 2026

    @clawsweeper

    Codex review: keeping this open for maintainer follow-up; there is still a little grit to resolve. Reviewed August 2, 2026, 1:57 PM ET / 17:57 UTC.

    Summary
    This issue remains necessary. Current main supports direct gateway URLs with setup-code or token-based pairing and a managed SSH local forward, but it does not provide OAuth2-proxy authentication or a configurable non-SSH local-process lifecycle for a Kubernetes port-forward. Choosing and securing either new boundary requires maintainer product direction before implementation.

    Reproducibility: unclear. The report provides a plausible Kubernetes port-forward scenario, but no current-main runtime evidence establishes whether the direct endpoint fails solely because of OAuth2-proxy behavior or what callback and token policy the proxy requires.

    Ways to help us reproduce this

    • Add a screenshot or short recording showing the behavior.
    • Add expected vs actual behavior.

    Maintainer decision needed

    Question Recommendation
    Which supported boundary should remote gateway connections adopt for deployments behind an OAuth2 proxy or Layer 7 load balancer: OAuth2-proxy authentication, a constrained managed local-forward process, or both as separately scoped features? Constrained managed forward first: Sponsor a narrowly specified local-forward runner for approved executable and argument configuration, with explicit start, readiness, stop, cancellation, diagnostics, and redaction rules; do not add a generic shell hook.

    Why: Current main intentionally has token/setup-code pairing and a fixed SSH-forward model only. Adding OAuth and arbitrary local command execution changes credential, process, and security policy that source inspection cannot safely choose.

    Next step
    A maintainer must choose the authentication and local-process security boundary before any implementation can be scoped safely.

    Review details

    Best possible solution:

    Define one supported remote-access boundary: preferably a constrained, explicitly configured managed local-forward mechanism with lifecycle ownership and diagnostics, plus a separately specified OAuth2-proxy compatibility path only if the gateway authentication protocol can support it safely.

    Do we have a high-confidence way to reproduce the issue?

    Unclear. The report provides a plausible Kubernetes port-forward scenario, but no current-main runtime evidence establishes whether the direct endpoint fails solely because of OAuth2-proxy behavior or what callback and token policy the proxy requires.

    Is this the best way to solve the issue?

    No. A generic script hook is not yet the best established solution because it would add an unrestricted local execution boundary; maintainer-approved constrained forwarding or a separately designed OAuth compatibility flow is safer.

    AGENTS.md: found and applied where relevant.

    Remaining risk / open question:

    • A generic pre-connect or stop hook would introduce a durable local code-execution and process-lifecycle boundary, including argument handling, cancellation, output redaction, and cleanup semantics.
    • An OAuth2-proxy flow may conflict with the current gateway device-token and signed-handshake model unless its browser, callback, token-storage, and reconnect behavior are explicitly designed.
    • The requested Kubernetes workflow may be better served by a constrained managed-forward capability than an unrestricted arbitrary-command setting, but that is a product and security decision.

    Codex review notes: model internal, reasoning high; reviewed against 8ac00c5f4977.

    Label changes

    Label justifications:

    • P2: This is a meaningful remote-connection capability gap, but no current regression or emergency user-impact evidence establishes P0 or P1 urgency.
    • impact:security: The proposed lifecycle mechanism would run and manage a local process, and the requested authentication option crosses the gateway trust boundary.
    • impact:auth-provider: The requested direct-connect alternative explicitly requires authentication through an OAuth2 proxy.
    Evidence reviewed

    What I checked:

    • Current connection model: Gateway records contain a WebSocket URL, shared/bootstrap token fields, and an optional SSH tunnel configuration. They contain no OAuth-provider or pre/post-connect command lifecycle configuration. (src/OpenClaw.Connection/GatewayRecord.cs:7, 8ac00c5f4977)
    • Supported forwarding boundary: The endpoint resolver uses the saved gateway URL when no tunnel is configured, or only ws://localhost: when an SSH tunnel is configured. The connection architecture document describes SSH local forwarding as the managed tunnel integration. (src/OpenClaw.Connection/GatewayClientEndpointResolver.cs:9, 8ac00c5f4977)
    • No generic lifecycle-hook implementation found: A source-tree search across the connection, tray, setup UI, and related tests found SSH process management and unrelated process launches, but no configurable pre-connect, post-connect, or stop-script setting for gateway connections. (8ac00c5f4977)
    • Feature-history provenance: Remote gateway setup and recovery appears to date to Barbara Kudiess's commit f51a861, while the current SSH tunnel recovery behavior was added by Vincent Koc in d7d153c. Neither commit establishes an OAuth2-proxy or Kubernetes lifecycle-hook path. (src/OpenClaw.Connection/SshTunnelService.cs:247, d7d153ca5d40)
    • Related work is an umbrella, not a duplicate: The open tracking issue lists this issue as one distinct child alongside separate provider and validation work. The validation issue is adjacent test coverage, not a replacement for the requested connection capability.
    • Maturity lookup unavailable: The required maturity helper was run from the checkout but could not read qa/maturity-scores.yaml because that scorecard is absent from this repository checkout, so no maturity label is selected. (qa/maturity-scores.yaml)

    Likely related people:

    • Barbara Kudiess: Authored the current remote-gateway setup and connection-recovery work, including commit f51a861. (role: remote connection and recovery contributor; confidence: high; commits: f51a8618ed7b, bc210e048aa9, c04c5fb06238; files: src/OpenClaw.Connection/GatewayConnectionManager.cs, src/OpenClaw.Tray.WinUI/Pages/ConnectionPage.xaml.cs)
    • Vincent Koc: Authored the current saved SSH tunnel recovery behavior in commit d7d153c. (role: recent SSH tunnel contributor; confidence: high; commits: d7d153ca5d40; files: src/OpenClaw.Connection/SshTunnelService.cs, src/OpenClaw.Connection/GatewayConnectionManager.cs)
    How this review workflow works
    • ClawSweeper keeps one durable marker-backed review comment per issue or PR.
    • Re-runs edit this comment so the latest verdict, findings, and automation markers stay together instead of adding duplicate bot comments.
    • A fresh review can be triggered by eligible @clawsweeper re-review comments, exact-item GitHub events, scheduled/background review runs, or manual workflow dispatch.
    • PR/issue authors and users with repository write access can comment @clawsweeper re-review or @clawsweeper re-run on an open PR or issue to request a fresh review only.
    • Maintainers can also comment @clawsweeper review to request a fresh review only.
    • Fresh-review commands do not start repair, autofix, rebase, CI repair, or automerge.
    • Maintainer-only repair and merge flows require explicit commands such as @clawsweeper autofix, @clawsweeper automerge, @clawsweeper fix ci, or @clawsweeper address review.
    • Maintainers can comment @clawsweeper explain to ask for more context, or @clawsweeper stop to stop active automation.
  2. added
    P2
    impact:security
    impact:auth-provider
    issue-rating: 🌊 off-meta tidepool
    clawsweeper:no-new-fix-pr
    clawsweeper:needs-maintainer-review
    clawsweeper:needs-product-decision
    clawsweeper:needs-security-review
    on Jun 15, 2026
  3. xrow commented on Jun 16, 2026

    @xrow
    Author

    I looked at the issue again. Meaning the device flow. The OAuth2-proxy is nice, but the generic command lifecycle hook is needed as a must to pass in a secure way.

  4. moved this from Backlog to Channels in Windows Companion Appon Jul 13, 2026
  5. 20 remaining items

  6. added
    issue-rating: 🦪 silver shellfish
    issue-rating: 🌊 off-meta tidepool
    clawsweeper:needs-security-review
    issue-rating: 🦐 gold shrimp
    clawsweeper:needs-info
    and removed
    clawsweeper:needs-security-review
    issue-rating: 🦪 silver shellfish
    issue-rating: 🌊 off-meta tidepool
    on Aug 2, 2026
  7. github-actions commented on Aug 17, 2026

    @github-actions
    Contributor

    This issue has been automatically marked as stale due to inactivity.
    Please add updated OpenClaw Windows details or it will be closed.

  8. github-actions commented on Aug 24, 2026

    @github-actions
    Contributor

    Closing due to inactivity.
    If this still affects OpenClaw Windows, open a new issue with the current version, logs, and fresh reproduction details.

  9. locked as resolved and limited conversation to collaborators on Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2clawsweeper:needs-infoclawsweeper:needs-maintainer-reviewclawsweeper:needs-product-decisionclawsweeper:no-new-fix-primpact:auth-providerimpact:securityissue-rating: 🦐 gold shrimpstale

    Type

    No type

    Fields

    Priority

    Medium

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions