Repository navigation
docs: add a runnable native CLI example and CLI provider sign-in - #160
Merged
Merged
Conversation
A standalone CLI on the OpenID Provider with the loopback and device flows, tokens in the OS keychain and no client secret, kept running by a new workflow. Replaces the placeholder in the native apps guide, and adds the provider flags of seamless profile login and seamless clients --session-exchange to the CLI reference, labelled merged but unreleased. Refs #137
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.
The CLI half of #137: a runnable CLI example with both sign-in flows, kept running in CI, plus real content where the guide had a placeholder and the CLI reference for
seamless profile login.Refs #137. It stays open: ADR 0002 N11 asks for the example to be kept runnable "against a released API and edge", and CI still builds the API from source until v0.23.0 ships (fells-code/seamless-auth-api#561). Everything else in the issue is met once this merges. Close it when the recipe pin moves to the released API and both workflows pass.
The example (
examples/native-cli/)A small Node CLI (
notes login,login --device,status,token,logout) onopenid-clientand@napi-rs/keyring, the same two libraries as the desktop example.127.0.0.1on an OS-picked port,BROWSERas an override, and the URL always printed.scripts/register-client.mjs, because the recipe's seed has no client with the device grant.Unlike the desktop example, a CLI is a new process per command and commands can overlap, so the access token is in the keychain too and a refresh takes a cross-process lock and re-reads inside it.
Why a standalone CLI, not
seamless profile loginThe issue asks for an example that shows adopters the pattern, with nothing specific to one product.
seamless profile loginspends the provider token atPOST /sessions/exchangefor a first-party admin session and keeps no provider token. An adopter's CLI should keep the provider's tokens and call its own API, so copyingprofile loginwould teach the wrong thing. It is also unpublished, and it has its own e2e in seamless-cli. The guide documents it in its own subsection, and says not to copy the exchange.The docs
build/native-apps-oidc: replaces the placeholder with the example, what differs for a CLI, andseamless profile loginthrough the provider, labelled merged but unreleased. Also drops a stale "still in review" about the recipe.reference/cli-commands:--device,--email-code,--oidc-issuer,--client-idonprofile login, the provider flags onprofile add, and a new shortclientssection for--session-exchange. All of it is labelled as needing an unpublished CLI and API v0.23.0.oidc_cli_client_idis described as not settable yet (feat(config): make oidc_cli_client_id writable once API v0.23 is released seamless-cli#351).What was run
e2e/run.mjsagainst the local recipe on macOS, with the real keychain: 74 of 74 checks. Recipe at30be59b, on spare ports and its own compose project. The stack was stopped and wiped afterwards.openid-client's generic error. A check now covers it.npm run lint,npm run typecheck,npm run build, and prettier on the example: all pass.Not tested
The OS opening a real browser (a capture script through
BROWSERhands the URL to Playwright's Chromium), a real passkey (virtual authenticator), a second physical device for--device, Windows Credential Manager, a locked or absent keychain, a device code that expires,slow_down, a published API, and a packaged build.seamless profile loginwas not run here. The docs for it come from the merged code at5e62f4a(instanceLogin.ts,providerSignIn.ts,helpTopics.ts,README.md, the changeset). The recipe pins an API from before the exchange route. fells-code/seamless-cli#349 records its own run.Known gaps
examples/native-desktop/README.mdstill links the recipe's merged PR docs: label self-hosted start pages as the self-hosted path #60. Not changed here.