Repository navigation
Reach a server added by its address as the person the host app signed in - #2797
Conversation
…igned in
replaceApp takes an optional hostToken, { tokenEndpoint, scope }: on a
deployment with embedded sign-in, OpenBot swaps a short assertion about the
signed-in person at the host app's token endpoint (RFC 7523 JWT bearer grant)
and sends the access token it gets to the server. Absent keeps what the
server has, and null takes it away, as entraScope does. An app answers
hostTokenEndpoint and hostTokenScope, null on every server not reached this
way. The bundle and the web app's generated client are regenerated.
A subsection of Embedded sign-in: the assertion OpenBot signs and where its key is published, the JWT bearer request it sends to the host's token endpoint, what it needs back, caching and re-checks, how an administrator sets it on a server with hostToken, and what refuses it.
…sking, and say what the assertion's header and iat carry
…ud and the call, nbf, and what the person reads for each answer
… nbf, a day's cache cap, and what the person reads when the host can't be reached or refuses
…nswer read up to 64 KiB, a 429 means try again, and what is refused before the host is asked
… key and clock rules
davidmckayv
left a comment
There was a problem hiding this comment.
The API side is clean and additive. hostToken on replaceApp is optional, and leaving it out keeps what the server has. hostTokenEndpoint and hostTokenScope are new response fields. No enum changes, nothing removed or made stricter, and oasdiff and the API spec job pass.
One change before merge
- The new "How this is reached / Host app" row hasn't been seen in a browser (
app/src/components/manage/plugin-page.tsx:1147-1170).- The only test of the row is a pure
connectionKindFortest. - The addition to
moved-apps.test.tspasses without any code change, so it isn't a regression test. - Please add a browser test of that row, and put a screenshot of a person-host server's page next to the Entra one in the PR (Chrome and Safari).
- The only test of the row is a pure
Non-blocking: copy
-
One thing has three names:
- the web app: "the app that signs them in to OpenBot" and "Host app" (
plugin-page.tsx:1039, ~1167) - the backend's refusals to a person: "the app OpenBot is part of"
- the admin refusals: "the app that embeds OpenBot"
Pick one and use it everywhere (openbot-copy glossary: one word for one thing).
- the web app: "the app that signs them in to OpenBot" and "Host app" (
-
The
person-hostdescription atplugin-page.tsx:1039runs to 30 words with a nested clause. Splitting it into two sentences would read better.
… everywhere Admin's page of a server reached through the app OpenBot is part of is now drawn in Chromium and WebKit (reached-as-the-person-browser.test.tsx, in the WebKit job's list, which runs both engines). It checks the Connection card's description, the "How this is reached" row's text, the token endpoint under it and its badge, beside the Entra server's page for comparison, light and dark, wide and on a phone. It fails against the previous copy and on main, where the row does not exist. The row's badge is now the token endpoint's host (auth.example.com) instead of "Host app", and the web app and the person-facing sentences in docs/configuration.md say "the app OpenBot is part of", the name the backend's refusals already use. The embedded sign-in section says once that the docs call it the host app. The card's description is split into two short sentences. The moved-apps.test.ts addition is dropped. needsNoAccountOfYours never reads hostTokenEndpoint, so the assertion restated the default for a server added by its address and passed with or without this change. There is no code here for it to guard; the browser test covers what changed.
|
Thanks Dave. Done in 28bf0c3, after merging main in 32e28ff:
|
|
On the screenshots: rather than attaching images, the new browser test is the evidence. |
davidmckayv
left a comment
There was a problem hiding this comment.
Approved at 28bf0c3. The browser test now covers the row in Chromium and WebKit, light and dark, at 1440 and 390, and it fails on the old copy. One name runs through all the copy, and the dead moved-apps addition is gone. CI was cancelled by an unrelated WebKit timeout (artifacts-screens, Share audience), so rerun the failed jobs and queue it once it's green.
# Conflicts: # .github/workflows/ci.yml
Adds a way for a deployment with embedded sign-in to reach an MCP server added by its address as the person the host app signed in. OpenBot signs a short assertion about the person (RFC 7523 JWT bearer grant) and swaps it at the host's own token endpoint for an access token, which it sends to the server as
Authorization: Bearer. No consent screen, no shared key.replaceApptakes an optionalhostToken({ tokenEndpoint, scope? }or null). Absent keeps what the server has; null takes it away, exactly asentraScope. It can't go withcredentialId,entraScope,tokenHeaderor a sign-in of the server's own (400,VALIDATION_ERROR).tokenEndpointis at most 2048 characters andscopeat most 1024, the limits the server enforces.AppanswershostTokenEndpointandhostTokenScope, null on every server not reached this way.api:generateoutput committed with the sources (web app client; the mobile and Recorder clients are unchanged).docs/configuration.mddocuments the assertion (header and claims), where OpenBot publishes its key (/.well-known/jwks.json), what the token endpoint must answer, caching, re-checks and requirements.Checks:
api:lint, oasdiff breaking (no breaking changes),api:live:diff,bun test api/(145 pass), the app tests touching apps and generated models (1338 pass), typecheck, lint and format clean.Changelog
Apps.
hostTokenon a server added by its address (replaceApp). OpenBot then swaps a signed assertion about the person at the host's token endpoint for an access token, and calls the server as them. Apps now answerhostTokenEndpointandhostTokenScope. See "Calling an MCP server as the person" in docs/configuration.md.🤖 Generated with Claude Code