Repository navigation
Return people to the calling app after they connect a connector account - #481
Merged
Merged
Conversation
Deploying with
|
| Status | Name | Latest Commit | Updated (UTC) |
|---|---|---|---|
| ✅ Deployment successful! View logs |
widefleet-docs | 82a0bfa | Nov 29 2026, 12:43 PM |
tnkuehne
force-pushed
the
app-connect-return
branch
8 times, most recently
from
November 29, 2026 12:42
ea25a7d to
82a0bfa
Compare
Where a connector called through an app's binding links to its own host as connectUrl, the app receives a link on its own host instead. The runtime serves that link: it checks the connector's groups, has the connector's UserConnection prepare a single-use ticket whose destination is the page the person came from, and redirects; the connector decides what the person sees. Failures return to that page with connectionError set to access or failed. Only Widefleet calls UserConnection; apps, MCP, the catalog and API documentation never see it.
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.
Problem
When an app calls a connector template and the person has not connected their account yet, the result carries
connectUrl, the connector's own page. After connecting there, the person stays on the connector's page and has to find their way back to the app.Change
The app just renders
result.connectUrl.UserConnection) called through the app's binding links to its own host asconnectUrl(any path),AppService.invokereplaces it with a link on the app's own host,/.widefleet/connect/<BINDING>. The runtime does not look at statuses; nested data and links another connector returned pass unchanged. Apps without web pages keep the connector's page. Connectors know nothing about the calling app.Referer) as the destination if it is a page of this app, otherwise the app's start page; checks the connector's access groups; has the connector'sUserConnectionprepare a single-use sign-in ticket for that destination; checks the launch URL as "My connections" does; and redirects withno-storeandno-referrer. The connector decides what the person sees there: the sign-in, or its page telling an administrator what to set up.After the sign-in the connector sends the person back to that page. When connecting cannot start or does not finish, they return with
connectionError=accessorfailed. AconnectionErrorfrom an earlier attempt is dropped. The path is handled before the app's assets and redirects.UserConnectionis privateThe entrypoint decides where a person returns after connecting, so only Widefleet calls it: the control plane refuses grants on it, the runtime refuses app calls through existing grants, MCP refuses calls, and it does not appear in uploaded API documentation, the service catalog, the API reference or
describe. "My connections" uses the same connection code.Tests
connectionReturnunit tests.UserConnection; grants on it are refused.RUN_SERVICE_TESTS=1): the app link replaces any link to the connector's host whatever the status or path, an app withoutUserConnectionkeeps its own link, nested data and a passed-through link stay; the person returns to the page they came from (query kept, fragment and an earlierconnectionErrordropped); another site, an ambiguous path or no referrer leads to the start page;connectionErrorfor an unknown binding, missing group (including a claimed group header) and a failing connector; refused calls through aUserConnectiongrant; unchanged app routes.Templates follow in the next PR of the stack.