feat: Sign in with OpenClaw ID - #166
Conversation
Adds an authorization-code login against the first-party OpenClaw ID provider (issuer https://id.openclaw.ai/api/auth) alongside GitHub OAuth: GET /api/auth/openclaw/start redirects with signed state, browser binding, and a S256 PKCE challenge reusing the existing OAuth transaction store; GET /api/auth/openclaw/callback exchanges the code via client_secret_basic, validates the id_token claims (issuer, audience, expiry, verified email), links or creates the user by email exactly like the magic-link path, and issues the same session cookie. Credentials arrive via OPENCLAW_ID_CLIENT_ID and OPENCLAW_ID_CLIENT_SECRET (optional OPENCLAW_ID_ISSUER override) and are passed through the Cloudflare Worker container env when present. The web login shows a browser-only OpenClaw ID button next to GitHub.
|
🦞👀 Pull request received. I will update this pull request when review starts. |
|
Codex review: needs real behavior proof before merge. Reviewed August 14, 2026, 10:12 PM ET / August 15, 2026, 02:12 UTC. ClawSweeper reviewWhat this changesThis PR adds browser-only OpenClaw ID OIDC sign-in, its API routes and deployment configuration, documentation, metrics, and a web login button. Merge readiness⛔ Blocked until real behavior proof is added - 13 items remain Keep open: the prior P1 security findings remain unfixed, and the optional login button also exposes an unavailable route on unconfigured deployments. Real browser/provider proof is still missing. Priority: P1 Review scores
Verification
How this fits togetherClickClack’s web login starts an OAuth transaction and sends the browser to an identity provider. The callback validates identity data, provisions or links a user, and creates the normal session cookie for the web app. flowchart LR
Browser[Browser login] --> Start[OAuth start route]
Start --> Provider[OpenClaw ID provider]
Provider --> Callback[OAuth callback]
Callback --> Validation[Identity validation]
Validation --> Account[User and workspace]
Account --> Session[Session cookie]
Session --> App[ClickClack web app]
Decision needed
Why: The current provider has no implemented organization or moderator mapping, so accepting all verified OpenClaw ID accounts changes established deployment access boundaries. Before merge
Findings
Agent review detailsSecurityNeeds attention: The added identity-provider trust boundary has two concrete session-creation flaws that must be resolved before merge. Review metrics
Merge-risk optionsMaintainer options:
Technical reviewBest possible solution: Use standard OIDC key discovery or a provider-authoritative JWKS path to verify ID-token signatures, and preserve existing restricted-deployment admission and role policy before enabling this provider. Do we have a high-confidence way to reproduce the issue? Yes: source inspection shows that a valid-claim token is parsed without signature verification and that the new callback provisions a normal member without the existing GitHub organization gate. Is this the best way to solve the issue? No: the feature needs cryptographic token verification and an explicit restricted-deployment policy before the new provider can safely create sessions. Full review comments:
Overall correctness: patch is incorrect AGENTS.md: found, but no applicable review policy affected this item. Codex review notes: model internal, reasoning high; reviewed against 18acea79465c. LabelsLabel justifications:
EvidenceSecurity concerns:
What I checked:
Likely related people:
Rating scale
Overall follows the weaker of proof and patch quality. Workflow
HistoryReview history (2 earlier review cycles)
|
Adds OIDC authorization-code login against id.openclaw.ai alongside GitHub and magic links: hardened flow mirroring the GitHub OAuth path (DB-backed single-use state, browser-binding cookie, S256 PKCE, client_secret_basic), user linking by verified email via the shared GetOrCreateUserByEmail helper, same session issuance. Web login gains an OpenClaw ID button (browser only; desktop handoff is a follow-up). Full Go suite, web tests, lint/typecheck/fmt green. Codex autoreview clean (0.96). Client registered (PKCE required); Worker secrets set — redeploy picks them up.