Skip to content

feat(openclaw-id): sign in with OpenClaw ID over a verified personal sign-in - #197559

Merged
jalehman merged 4 commits into
mainfrom
feat/ocf-509-ocid-personal-sign-in
Nov 12, 2026
Merged

jalehman merged 4 commits into
mainfrom
feat/ocf-509-ocid-personal-sign-in

Conversation

@jalehman

@jalehman jalehman commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Related: Linear OCF-509. Depends on openclaw/openclaw-id#30 (the issuer's device grant) and openclaw/openclaw-id#31 (lets real browsers approve a code). Both are merged and deployed to staging.

What Problem This Solves

Sign in with OpenClaw ID works only in a Control UI opened on the claw's own computer. Over Tailscale or another verified proxy, the menu says "Sign in on the computer that runs this claw", so setting up a remote claw needs an SSH tunnel.

User Impact

With the OpenClaw ID Labs switch on, a Control UI connection with a verified personal identity can sign in with OpenClaw ID and see the account in the identity menu. This covers Tailscale Serve, Cloudflare Access or another trusted proxy, and enterprise principals.

  • The sign-in proves only which OpenClaw ID account the browser holds. It grants nothing: no owner device, no root ceremony, no membership, no claw-record write.
  • Turn on remote access and its link code stay on the claw's computer (OCF-511).
  • Shared token or password connections, members and owner devices over the OpenClaw ID tunnel, host-bound ingress grants, and connections without a personal profile still cannot sign in.

Why This Change Was Made

The issuer only redirects to the loopback callbacks the Control UI client registers, so a remote origin can't receive a redirect. For those connections the Gateway uses the issuer's device grant (RFC 8628) instead of the popup:

  • openclawId.account (device_begin) asks the issuer for a user code.
  • The Control UI shows the code and an Open OpenClaw ID link.
  • device_poll asks the Gateway to poll the token endpoint.
  • The Gateway checks the ID token (iss, aud, exp, sub; the device grant has no nonce) and returns the account over the authenticated connection.

Design details:

  • Who can poll: a pending device sign-in is bound to the profile that started it. Another connection can neither redeem nor cancel it.
  • Scope: openclawId.account needs operator.read, because it changes no authority. openclawId.authority keeps operator.admin, and its account_* popup actions stay loopback-only.
  • No account record: remote sign-ins never call recordVerifiedAccount (the owner-name overwrite is OCF-512).
  • Status: openclawId.status reports accountSignIn: "popup" | "device" | null, and the menu uses it.
  • Sign-out: signing out in another tab while a device sign-in is starting or polling retires that sign-in.
  • Token custody: after the issuer returns the ID token, the Gateway checks again before handing it over: the Labs switch, a live personal connection, the device route, and the profile that started the sign-in. If any of these changed while it waited, the token is discarded.

Evidence

  • Gateway tests:

    • account-sign-in.test.ts: device flow pacing, slow_down, single redemption, owner-bound polling, denial, and refusals for the wrong aud, an injected nonce, an expired token, or a device endpoint that is missing or off the issuer origin.
    • server.openclaw-id-sign-in.test.ts: the route for each connection kind; real dispatch admits openclawId.account with read scope while openclawId.authority needs admin; personal connections can't use the popup or link-code actions; Labs off.
    • labs-off.test.ts.
    • Token custody (5f6001b): six handler cases cover Labs switched off, the connection gone, the route changed, and the profile changed while the issuer answered. Four of them fail on the previous commit.
  • UI tests (account-menu.test.tsx, ui-error.test.ts): device sign-in to the stored account and the identity menu, sign-out during start, cancelled polling stops, no owner actions after a device sign-in.

  • pnpm tsgo:core, pnpm tsgo:ui, the ui-components, gateway-root and gateway-other test typechecks, oxlint, check:control-ui-controllers and ui:i18n:verify pass.

  • Autoreview (Astra): no P0 or P1 findings. Both P2s are fixed: the method scope is now read, and the sign-out generation is captured before the attempt begins.

  • Boot size (a46b423): the device sign-in code and dialog strings load with the device sign-in dialog. New and chat boot JS are within build variance of main (+3 B; the first full CI run measured +460 B). ui:check-performance:base passes locally against main.

  • E2E (a46b423): the account-menu and popup fixtures report accountSignIn: "popup", as a loopback Gateway does. Both e2e files pass locally.

  • Test lines: config/test-lines-allocations/197559-openclaw-id-personal-sign-in.txt records 188 lines over the allowance. Device sign-in over a personal connection is security-sensitive, so the tests cover:

    • issuer pacing and single redemption;
    • token checks (aud, nonce, expiry);
    • profile-bound polling and token custody;
    • read-scoped dispatch and Labs off;
    • UI sign-out races.

Live proof against staging OpenClaw ID

Real Gateways built from this branch, with headless Chromium. The personal identity comes from a trusted proxy on the same host (x-forwarded-user), so the browser connects as a named person, not as the claw's own computer.

OpenClaw ID testnet, head 5f6001b. The gateway lab host in us-west-2 ran a throwaway Gateway with its own port and state directory. It didn't touch the host's live claw, and everything was removed afterwards. The browser reached it through SSM port forwards.

Check Result
"Sign in with OpenClaw ID" is enabled over a personal sign-in pass
Successful sign-in: device code → approve on staging → the browser holds the account pass
Identity menu after sign-in shows the account and Sign out; owner actions stay unavailable pass (Turn on remote access stays disabled until OCF-511)
Cancel while waiting stops polling pass (2 polls before, 2 after)
Another profile tries to collect someone else's pending code refused, state_mismatch; the owner's code stays pending
Sign out in another tab while waiting, then approve stays signed out: "You signed out while sign-in was in progress"
Profile merged away while its approved code is pending no token: both sockets close (4001), and a fresh connection gets state_mismatch

Mac Studio, base 082ed658 and head 5f6001b.

Check Result
Base: "Sign in with OpenClaw ID" is disabled over a personal sign-in pass
Shared token over the network can't sign in (accountSignIn: null, device_begin → not_personal_connection) pass
Loopback (both builds) still opens the issuer's PKCE popup and gets no device code pass

The testnet Gateway installed only core runtime dependencies, because the host didn't have room for the agent SDK binaries. The ACP and Codex plugins therefore didn't load; neither is involved in sign-in. The redacted traces contain no tokens, codes or addresses.

Before (082ed658, personal sign-in) After (head)
Before: Sign in with OpenClaw ID is disabled and says to sign in on the claw's computer After: Sign in with OpenClaw ID is enabled for alice
Device code in the Control UI Issuer confirmation (staging)
Device sign-in dialog with a code and Open OpenClaw ID Issuer page asking to confirm the same code
Signed in Signed out in another tab while waiting
Identity menu showing the OpenClaw ID account and Sign out Dialog says sign-in did not finish

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
ClawSweeper picked this up.

Pull request received. I will update this pull request when review starts.

ClawSweeper review complete

ClawSweeper finished reviewing this revision. The review result is being finalized.

View the workflow run.

@openclaw-barnacle openclaw-barnacle Bot added docs Improvements or additions to documentation app: web-ui App: web-ui gateway Gateway runtime size: XL labels Nov 12, 2026
@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. P2 Normal backlog priority with limited blast radius. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

Codex review: needs maintainer review before merge.

What this changes

Adds OpenClaw ID device-code sign-in for Control UI connections authenticated with a verified personal identity.

Example: Alice opens the Control UI through a trusted proxy with OpenClaw ID Labs enabled.

  • Before: Sign in with OpenClaw ID is disabled and directs her to the claw's computer.
  • After: Alice approves a displayed device code and sees her account and Sign out, while remote-access linking remains local-only.

Review scores

Measure Result What it means
Overall readiness 🐚 platinum hermit (4/6) Useful, coherent feature with real-Gateway evidence and no concrete introduced defect; existing account storage keys and serialized account shape remain unchanged.
Proof confidence 🐚 platinum hermit (4/6) ✨ media proof bonus Sufficient (screenshot): Inspected before/after browser media and the supplied staging real-Gateway results for personal sign-in, issuer approval, account display, cancellation, cross-profile refusal, and retained loopback behavior; the subsequent head changes relocate equivalent code and update fixtures rather than change the exercised protocol.
Patch quality 🐚 platinum hermit (4/6) No actionable review findings were identified.

Product

Kind: Feature · Worth it: Yes · Fix scope: Complete
User problem: A user with a verified personal connection must currently open the Control UI on the claw's computer to sign in with OpenClaw ID.
Reason: Maintainer-approved direction removes a demonstrated sign-in obstacle while keeping account identity separate from claw membership and linking authority.

Merge readiness

✅ Ready for maintainer review

Keep open: this maintainer-authored feature addresses a demonstrated sign-in limitation, and review found no actionable introduced defect.

Priority: P2
Reviewed head: a46b423dd22fa10e248ec18ed87ddf6c283173d1

Before merge

None.

Findings

None.

Agent review details

How this fits together

The Control UI sends authenticated account RPCs to the Gateway, which obtains a device grant from the configured issuer and returns the verified account and ID token to browser-owned account storage.

flowchart LR
  A[Personal browser connection] --> B[Gateway sign-in route]
  B --> C[Existing sign-in owner]
  C --> D[OpenClaw ID issuer]
  D --> C
  C --> E[Profile-bound account response]
  E --> F[Browser account storage and menu]
Loading

Technical review

Best possible solution:

Extend the existing sign-in owner with the device grant while preserving loopback-only linking and the existing browser account format.

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

Current main explicitly restricts account sign-in to loopback, and the supplied before screenshot demonstrates the disabled action over a personal connection; this review ran no target code.

Is this the best way to solve the issue?

The device grant addresses the issuer's loopback redirect restriction through the existing sign-in owner, and the lazy dialog keeps this optional flow off the normal boot path.

AGENTS.md: found and applied where relevant.

Codex review notes: model internal, reasoning medium; reviewed against 46350dafd299.

Provenance checked

Testing

Proof path: shipped entry point.

Security

None.

Evidence

What I checked:

Likely related people:

  • Josh Lehman: Raw commit 428ca7d adds src/gateway/openclaw-id/channel.ts:13 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 428ca7daffc9; files: src/gateway/openclaw-id/channel.ts)
  • Vyctor H. Brzezowski: Raw commit 5a371b7 adds ui/src/components/openclaw-id/account-menu.tsx:198 relative to its recorded parents. This identifies author metadata, not feature responsibility or a PR merger. (role: source-line author; confidence: high; commits: 5a371b71d80e; files: ui/src/components/openclaw-id/account-menu.tsx)

PR surface

Source +609, Tests +588, Docs +12, Generated 0, Other +4. Total +1213 across 26 files. Added test files: 1.

View PR surface stats
Area Files Added Removed Net
Source 13 647 38 +609
Tests 10 595 7 +588
Docs 1 22 10 +12
Config 0 0 0 0
Generated 1 2 2 0
Other 1 4 0 +4
Total 26 1270 57 +1213

Preflight source

Source unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified.

Review metrics

Metric Value Why it matters
Gateway API surface 1 new RPC, 2 actions, 1 status field Adds read-scoped openclawId.account with device_begin/device_poll and accountSignIn route reporting, without a new configuration option.

Labels

Label changes:

  • add proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Label justifications:

  • P2: Adds useful remote personal sign-in within an opt-in Labs feature, with limited blast radius.
  • rating: 🐚 platinum hermit: Overall readiness is 🐚 platinum hermit; proof is 🐚 platinum hermit and patch quality is 🐚 platinum hermit.
  • status: 👀 ready for maintainer look: ClawSweeper has no concrete contributor-facing blocker left for this PR.
  • proof: sufficient: Contributor real behavior proof is sufficient.
  • proof: 📸 screenshot: Contributor real behavior proof includes screenshot evidence.

Rating scale

6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior.

Workflow

ClawSweeper edits this one comment on every review. Comment @clawsweeper re-review for a fresh review only. Repair and merge execution lanes are retired.

History

Review history (3 earlier review cycles)
  • reviewed 2026-11-12T05:49:46.343Z sha 7e925f9 :: needs real behavior proof before merge. :: none
  • reviewed 2026-11-12T10:08:25.847Z sha 5f6001b :: needs changes before merge. :: none
  • reviewed 2026-11-12T14:26:37.855Z sha 5bfe343 :: needs maintainer review before merge. :: none

Reviewed November 12, 2026, 10:20 AM ET / 15:20 UTC (Revision 4).

@clawsweeper clawsweeper Bot removed rating: 🧂 unranked krab Not merge-ready due to missing proof or serious correctness/safety concerns. merge-risk: 🚨 security-boundary 🚨 May affect sandboxing, authorization, credentials, or sensitive data. status: 📣 needs proof The PR needs real behavior proof before ClawSweeper can clear the contributor ask. labels Nov 12, 2026
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@jalehman
jalehman force-pushed the feat/ocf-509-ocid-personal-sign-in branch from 5f6001b to 5bfe343 Compare November 12, 2026 14:18
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added the clawsweeper:intake:feature Preliminary submission classification; full source review pending. label Nov 12, 2026
@clawsweeper clawsweeper Bot added status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR. and removed status: ⏳ waiting on author ClawSweeper has contributor-facing work open and is waiting for author action. clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@jalehman
jalehman marked this pull request as ready for review November 12, 2026 14:36
@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

⚠️ Security sensitive changes

This maintainer PR changes sensitive security components.

No secops approval is required. This comment is informational because the PR author has Maintain or Admin access.

  • Current SHA: a46b423dd22fa10e248ec18ed87ddf6c283173d1
  • Maintainer: @jalehman
  • Repository role: admin

These security sensitive changes were made:

  • src/gateway/methods/core-descriptors.ts: Controls Gateway authentication, pairing, or caller permissions. Check identity validation, scope checks, and revocation.

Carefully review these changes before merging.

… declare popup sign-in

- Device sign-in code and dialog strings load with the device sign-in dialog, keeping new/chat
  boot JS at main's size (+3 B against +460 B).
- E2E menu and popup fixtures report accountSignIn: popup, as the loopback Gateway does.
- Record the test-line growth for the sign-in security tests.
@jalehman

Copy link
Copy Markdown
Contributor Author

@clawsweeper re-review

@clawsweeper

clawsweeper Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Contributor

🦞👀
Exact review queued.

Re-review progress:

@clawsweeper clawsweeper Bot added clawsweeper:intake:feature Preliminary submission classification; full source review pending. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. and removed clawsweeper:intake:feature Preliminary submission classification; full source review pending. labels Nov 12, 2026
@jalehman
jalehman merged commit 9979e74 into main Nov 12, 2026
136 checks passed
@jalehman

Copy link
Copy Markdown
Contributor Author

Merged via squash.

@jalehman
jalehman deleted the feat/ocf-509-ocid-personal-sign-in branch November 12, 2026 20:02
github-actions Bot pushed a commit to Desicool/openclaw that referenced this pull request Nov 13, 2026
…sign-in (openclaw#197559)

* feat(openclaw-id): sign in with OpenClaw ID over a verified personal sign-in

* fix(openclaw-id): read-scoped device sign-in method and sign-out guard from its start

* fix(openclaw-id): release a device sign-in's token only to the live connection that started it

* fix(openclaw-id): keep device sign-in off the boot path; e2e fixtures declare popup sign-in

- Device sign-in code and dialog strings load with the device sign-in dialog, keeping new/chat
  boot JS at main's size (+3 B against +460 B).
- E2E menu and popup fixtures report accountSignIn: popup, as the loopback Gateway does.
- Record the test-line growth for the sign-in security tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app: web-ui App: web-ui docs Improvements or additions to documentation gateway Gateway runtime P2 Normal backlog priority with limited blast radius. proof: 📸 screenshot Contributor real behavior proof includes screenshot evidence. proof: sufficient ClawSweeper judged the real behavior proof convincing. rating: 🐚 platinum hermit Good normal PR readiness with ordinary maintainer review expected. security-sensitive-changed size: XL status: 👀 ready for maintainer look ClawSweeper has no concrete contributor-facing blocker left for this PR.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant