Repository navigation
Conversation
thatopen login without a token, and EngineServicesClient.signInWithBrowser. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Description
Sign in through the browser, as the Revit plugin does, instead of pasting a token.
CLI.
thatopen loginwithout--tokenshows a code, opens the platform and waits for it to be confirmed there.--tokenstill works as before, for CI and servers.preAction).cliClientrenews it during long-running commands such asserveandmcp, and stores what it renewed.SDK.
EngineServicesClient.signInWithBrowser(options)returns a client that keeps its token fresh while the process lives.EngineServicesClient.fromBrowserSession(session)starts again from a session kept earlier, without asking the person.signInWithBrowserandrefreshBrowserSessionare also exported on their own, plusclient.setAccessTokenandclient.stopRenewing.Needs ThatOpen/platform_backend-api#599 deployed first: the platform refuses a
claimfrom a connector it does not know.Additional context
Tested: 5 new tests in
browser-sign-in.test.ts, withfetchmocked.tscis clean and the CLI bundle builds. 13 tests fail invitest run, the same 13 without this change onorigin/main: inclient.test.ts,platform-client.notifications.test.tsand one more file.Not tested: nothing has run against a real platform, because that needs #599. The browser opening and the renewal have not run for real, including on Windows, where it uses
rundll32 url.dll,FileProtocolHandler.Known limits:
cliClientdoes not renew during a run:engine-scriptandrevit-addinpass it on to something else. They get a token renewed at the start of the command, so a run longer than its life (15 minutes on the platform) fails with a 401. For those,--tokenstill works.signInWithBrowserin a web page outside the platform is not covered. It would need CORS on those routes, and a website wants OAuth with PKCE instead.~/.thatopen/config.jsonor.thatopenwith mode 0600, as the token is today. On Windows that mode does not protect the file.Decision: I kept a session rather than creating a long-lived API token from the sign-in, so that disconnecting under Connected apps really cuts it. The cost is limit 1.
🤖 Generated with Claude Code