@@ -194,7 +194,8 @@ admin dashboard (`AdminService` in `apps/auth-service/src/admin`), and so does e
194194setting administrators may change on another account (` AccountService ` in
195195` apps/auth-service/src/account ` ). Commands need only
196196` AUTH_DATABASE_URL ` (` invite create ` also needs ` AUTH_PUBLIC_BASE_URL ` , to build its
197- link, and ` user recover ` needs it and ` AUTH_TOKEN_DIGEST_KEY ` , to derive its link), so
197+ link, ` user recover ` needs it and ` AUTH_TOKEN_DIGEST_KEY ` , to derive its link, and
198+ ` client origin add ` needs it to tell auth's own domain apart), so
198199they work while auth is down: they are the break-glass path when the
199200dashboard or auth's frontends are unreachable. In deployed environments,
200201run them with ` piquelctl app exec piquel-fr auth --env ENV -- auth-service … ` (see
@@ -268,9 +269,10 @@ just auth account alice emails remove <email-id> --reason "Asked by email"
268269 to recover one.
269270- Failures print their causes and exit with 1; usage errors exit with 2.
270271
271- Administrators manage accounts, sessions, invitations and other administrators
272- from the admin dashboard, which auth serves on ` AUTH_ADMIN_LISTENER ` for the
273- dashboard's origin, ` AUTH_ADMIN_ORIGIN ` , and which only a private route reaches.
272+ Administrators manage accounts, sessions, invitations, other administrators and
273+ the origins approved for clients' pages to sign users in from the admin dashboard,
274+ which auth serves on ` AUTH_ADMIN_LISTENER ` for the dashboard's origin,
275+ ` AUTH_ADMIN_ORIGIN ` , and which only a private route reaches.
274276Its pages call ` AdminService ` in-process; there is no admin API.
275277
276278An administrator signs in by a handoff from auth: the dashboard sends the browser
@@ -523,6 +525,50 @@ tokens it already holds expire within five minutes. An administrator removes one
523525the same way from the account's Connected apps page on the dashboard, with a
524526reason the owner sees in their history.
525527
528+ #### Passkey sign-in on an application's own pages
529+
530+ A trusted client's pages can sign users in with their auth passkeys without
531+ leaving for auth's pages, through WebAuthn related origins (WebAuthn Level 3
532+ §5.11). An administrator approves each origin on the dashboard's Clients page,
533+ which lists them, or with the CLI:
534+
535+ ``` sh
536+ just auth client origin add blog https://blog.example
537+ just auth client origin list # --output json for scripts
538+ just auth client origin remove blog https://blog.example
539+ ```
540+
541+ The client must be trusted, since this sign-in skips the consent page, and the
542+ origin must be the origin of one of its redirect URIs. Browsers honour only a few
543+ distinct domains in the list, so approved origins may span at most 5 registrable
544+ domains (` example ` counts once for ` app.example.co.uk ` and ` www.example.co.uk ` ).
545+ Browsers count origins within auth's own domain too, as ` piquel ` ; a host without a
546+ registrable domain, such as ` localhost ` , counts none and is accepted only within
547+ auth's domain. ` /.well-known/webauthn ` lists the approved origins, cacheable for
548+ five minutes and readable from any origin. Auth refuses a removed origin's
549+ sign-ins at once, and deleting a client removes its origins.
550+
551+ The page pushes an authorization request with PKCE, from its own origin, then posts
552+ its ` request_uri ` as ` {"request_uri": …} ` to ` /webauthn/related/start ` , with
553+ ` content-type: application/json ` and ` x-piquel-csrf: 1 ` . It runs the WebAuthn
554+ assertion the answer describes, then posts ` {"ceremony_id": …, "credential": …} `
555+ to ` /webauthn/related/finish ` , which answers ` {code, state, iss} ` as JSON instead
556+ of redirecting. The page checks ` state ` and ` iss ` , and redeems the code with its
557+ verifier as usual. These calls send no cookies and get none: the sign-in creates a
558+ session that only the client's tokens use, recorded with the page's origin in the
559+ user's security history. A request with ` prompt=consent ` or ` prompt=none ` , or an
560+ ` id_token_hint ` naming an account without passkeys, is refused at start with
561+ ` interaction_required ` and left unclaimed, so the page can send the browser to
562+ ` /oauth/authorize?client_id=…&request_uri=… ` with it instead. Finish answers
563+ ` interaction_required ` when the sign-in falls short of the request, such as a
564+ recovered passkey during its probation against ` acr_values=phr ` , or when the
565+ account is scheduled for deletion, which only auth's pages restore; the request was
566+ claimed at start, so the page pushes a fresh one before sending the browser to
567+ auth with it. The page should also redirect when the browser lacks related origins
568+ (` PublicKeyCredential.getClientCapabilities() ` has no ` relatedOrigins ` ), and push a
569+ fresh request first when a start or the passkey prompt failed, since auth may have
570+ claimed the first one.
571+
526572### Authentication claims
527573
528574ID and access tokens report how the browser session behind the grant
0 commit comments