Add spark_login so Claude can auth in-chat without a pre-minted token - #4
Open
Hewlbern wants to merge 1 commit into
Open
Add spark_login so Claude can auth in-chat without a pre-minted token#4Hewlbern wants to merge 1 commit into
Hewlbern wants to merge 1 commit into
Conversation
Mint a 30-day Spark connect token from handle+password via /idp/login (and optional spark_register), keep the existing Bearer header path, and document both Claude connector setups. Co-authored-by: audacity <Hewlbern@users.noreply.github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Hewlbern
marked this pull request as ready for review
September 1, 2026 22:57
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claude (and Gemini Spark) can now log in with handle + password inside the chat, then save and share conversation logs to the user's Solid pod. A pre-minted token from
/appis no longer required.What changed
New MCP tools on the Vercel-hosted server (
api/mcp.js, mirrored infrontend/apiand Gointernal/openidmcp):spark_login—handle(or email) +password→ POST/idp/login→ mint a 30-day Spark connect token the same way/api/spark-tokendoes (api/_lib/jwt.js+ grant persist). Returns{ ok, handle, webId, mcpUrl, token, expires, tokenType: "Bearer", hint }. Does not echo or log the password.spark_register— handle + password + optional name, same mint path via/idp/register.Server instructions tell the model: if the user says “save this conversation”, “share these logs”, or “log into my OpenID”, call
spark_loginwhen there is no token yet, thenspark_save_conversationwith the full thread, thenspark_share_conversationand return the/share/c/…URL.The existing Authorization: Bearer header path (Claude custom connector Request headers /
/appmint) still works.Claude setup
A. Mint on
/appand pasteAuthorization: Bearer <token>into the connector headers.B. Add
https://<origin>/mcpwith no auth and usespark_loginin chat.Railway is unchanged (no GitHub reconnect; pod stays on the ghcr.io image).
Preview proof
Preview: https://identity-o5dbm6myc-hewlberns-projects.vercel.app
GET /mcpadvertisesspark.login: spark_login.Result (2026-09-01):
tools/listincludesspark_login,spark_register,spark_save_conversation,spark_share_conversationspark_register+spark_login(handle, pass)minted a 30-day Bearer (password not echoed)spark_save_conversationwrote the threadspark_share_conversationreturned/share/c/…Example share: https://identity-o5dbm6myc-hewlberns-projects.vercel.app/share/c/prove1788303427.799da161a617ea0c1d4ebaa724e05b72