Repository navigation
docs: add a runnable native desktop example and extend the native apps guide - #158
Merged
Merged
Conversation
An Electron app signs in through the system browser with PKCE S256 and a loopback redirect on an OS-picked port, and keeps its refresh token in the OS credential store. An Express backend verifies its access token with the verify-only guards in @seamless-auth/express, answers the RFC 9470 challenge on one route, and sends an account notice through a client link. The e2e drives the app with Playwright against the provider's local recipe. The notice needs API v0.23.0, so it runs on the commit the recipe pins. Refs #137
Runs on pull requests that touch the example and weekly, so the example doubles as a regression check for the pattern in ADR 0002. Refs #137
Adds token storage, the three registry records, backend verification, step-up, notices through a client link, required versions, the runnable example, where DPoP will fit, and a placeholder for the CLI example. Corrects the post-logout statement: a loopback URI registered for a native application matches on any port. 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 desktop half of #137: a runnable desktop app and backend, and the native apps guide. The CLI half waits on fells-code/seamless-cli#316 and is a marked placeholder that claims nothing, so #137 stays open.
Refs #137
The example (
examples/native-desktop/)@napi-rs/keyring(pinned tosecret-serviceon Linux, where it otherwise falls back silently to a memory-only keyring).createResourceServerfrom published@seamless-auth/express0.24.0, requires a recent phishing-resistant sign-in on one route, and sends an account notice through the client link.tsconfig.jsonexcludesexamples, so nothing reaches the site build.The guide
Extends
build/native-apps-oidc: keychain storage, a versions table, the three registry records, backend verification with theclient_idallowlist, step-up, notices through a link, the runnable example, and where DPoP will fit (marked not shipped). API v0.23.0 is labelled unpublished wherever links orclientIdappear. It also corrects a claim: on edge v0.3.0 a native client's loopbackpost_logout_redirect_urimatches on any port (tested).What was run
e2e/run.mjsagainst the local recipe: 64 of 64 checks on macOS and in an Ubuntu 24.04 container underxvfb-runand gnome-keyring. It coversstaterefusal, the listener not reachable off loopback, the refresh token in the keychain and in no file,max_ageexpiry and the challenge, the backend refusing its own client credentials token, restore on relaunch, revocation and sign-out. The new workflow has not run on GitHub until this PR. It was run at recipe commitddd5009; the pin is now the merge commit30be59b, whoselocal/is identical.Not tested
The OS opening a real browser (Playwright's Chromium stands in), a real passkey (virtual authenticator), Windows Credential Manager, a packaged and signed build, a private-use scheme redirect, fail-closed with no Secret Service, and the refresh token replay rule.
Known gaps
noticesEnabled, soscripts/enable-notices.mjsdoes. The recipe's mailbox also drops the subject, so only the body attribution is asserted.