ToolUp.AuthProviders.Passkey.Client
0.22.0
Prefix Reserved
dotnet add package ToolUp.AuthProviders.Passkey.Client --version 0.22.0
NuGet\Install-Package ToolUp.AuthProviders.Passkey.Client -Version 0.22.0
<PackageReference Include="ToolUp.AuthProviders.Passkey.Client" Version="0.22.0" />
<PackageVersion Include="ToolUp.AuthProviders.Passkey.Client" Version="0.22.0" />
<PackageReference Include="ToolUp.AuthProviders.Passkey.Client" />
paket add ToolUp.AuthProviders.Passkey.Client --version 0.22.0
#r "nuget: ToolUp.AuthProviders.Passkey.Client, 0.22.0"
#:package ToolUp.AuthProviders.Passkey.Client@0.22.0
#addin nuget:?package=ToolUp.AuthProviders.Passkey.Client&version=0.22.0
#tool nuget:?package=ToolUp.AuthProviders.Passkey.Client&version=0.22.0
ToolUp.AuthProviders.Passkey.Client
Client-side WebAuthn / passkey sign-in UI for ToolUp.Platform — the browser half of the passkey flow. It drives the browser-native navigator.credentials API against the server companion's ceremony endpoints, with zero npm dependencies (WebCrypto-era browser primitives via [<Emit>], mirroring the OidcClient precedent).
This is a Fable / Feliz client-tier package: it ships its .fs source under fable/ in the nupkg and is compiled as part of the consuming app's Fable build. Pair it with the server-side ToolUp.AuthProviders.Passkey companion, which runs the ceremonies and mints the session token this UI stores.
What it provides
PasskeyRegister.handler— the companion-exportedAuthUIHandlervalue (tag"passkey"). Adding it toClientConfig.Handlers.AuthUIHandlerspulls the module into the Fable import graph and wires the shell'sAuthUIProviderto dispatch passkey sign-in — a pure value export, no module-load side effect orinit ()anchor.PasskeyShell— the shell wrapper handed to the SDK via that handler. It holdsPasskeyAuthState(Checking | SignedIn | SignedOut | Failed) in React-local state (no Elmish model pollution) and renders the sign-in / register / loading / error screens. There is no password field anywhere — passwordless is the point.PasskeyClient— the ceremony orchestration:register,signIn,hasSession,signOut, and anisSupported ()feature probe. On a successful ceremony the minted platform session JWT is stored viaUserSession.setAuthToken, exactly as a bearer token obtained by any other means.
How a consumer enables it
Configure the client AuthUI mode and register the handler value in ClientConfig:
open ToolUp.Platform
open ToolUp.AuthProviders
let clientConfig =
{ ClientConfig.defaults with
AuthUI = PasskeyAuthUI PasskeyUIConfig.defaults
Handlers =
{ ClientHandlerRegistry.empty with
AuthUIHandlers = [ PasskeyRegister.handler ] } }
PasskeyUIConfig is small:
| Field | Meaning | Default |
|---|---|---|
ApiBase |
Base path for the server ceremony endpoints — the UI posts to {ApiBase}/register/* and {ApiBase}/assert/*. |
/api/passkey |
AllowRegistration |
Whether the sign-in screen offers a "Register a passkey" affordance (plus a bootstrap-token field for first-time setup). Registration is still gated server-side; this only controls the UI. | true |
PasskeyUIConfig.defaults matches the server companion's default route mounting, so an app that composes PasskeyServerApp with SDK defaults needs no ApiBase override.
The ceremony flow
register and signIn share one orchestration:
POST {ApiBase}/register/begin(or/assert/begin) → the server's Fido2 options JSON plus achallengeId.- Convert the options' base64url buffers (
challenge,user.id,excludeCredentials[].id) to theUint8Arrayform the browser API requires, then callnavigator.credentials.create(registration) or.get(assertion). - Serialise the returned
PublicKeyCredentialinto the attestation / assertion wire shape (base64url buffers). POST {completePath}?challenge={challengeId}with that body → the minted session JWT →UserSession.setAuthToken.
The base64url ⇄ ArrayBuffer conversions and the response serialisation are the only [<Emit>] shims — they operate on the live ArrayBuffer / PublicKeyCredential objects the WebAuthn API hands back; everything above them is ordinary F# orchestration. A user-cancelled ceremony, an absent authenticator, or a timeout surfaces as a non-probing Failed message.
signIn accepts an empty username for a discoverable-credential (usernameless) flow. signOut clears the stored token; the UserMenu header button pairs it with a page reload.
See also
../Passkey/README.md— the server companion (IAuthProvider+ ceremony routes + session-token issuance) this UI drives.
Licensed under Apache-2.0.
Part of the ToolUp Platform SDK — see github.com/ToolUp-Forge/toolup-forge for full documentation.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- Fable.Browser.Dom (>= 2.20.0)
- ToolUp.Platform.Client (>= 0.22.0)
- ToolUp.Platform.Core (>= 0.22.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.