Skip to main content

Crate rustauth_passkey

Crate rustauth_passkey 

Source
Expand description

Server-side passkey plugin for RustAuth.

The plugin is server-only. It exposes Better Auth-inspired HTTP endpoints under /passkey/*, contributes a passkeys table to the RustAuth schema, and uses webauthn-rs for WebAuthn ceremony generation and verification.

use rustauth_core::options::RustAuthOptions;
use rustauth_passkey::{passkey, PasskeyOptions};

let options = RustAuthOptions::new()
    .secret("secret-a-at-least-32-chars-long!!")
    .base_url("https://app.example.com")
    .plugin(passkey(PasskeyOptions::default()));

WebAuthn registration and authentication state is persisted server-side in RustAuth’s verification storage and keyed by a signed short-lived cookie. This is why the crate enables webauthn-rs state serialization: the state is not trusted from the client and is deleted after successful verification.

Structs§

AfterAuthenticationVerificationInput
AfterRegistrationVerificationInput
AuthenticatorSelection
Authenticator selection hints for generated registration options.
Passkey
PasskeyAdvancedOptions
Advanced passkey plugin settings.
PasskeyAuthenticationOptions
PasskeyAuthenticationRejected
Rejection returned by authentication after_verification hooks to abort login after WebAuthn proof verification without updating the passkey counter or minting a session.
PasskeyAuthenticationStart
PasskeyChallengeRateLimit
Per signed challenge cookie rate limits for passkey verify endpoints.
PasskeyExtensionsInput
PasskeyManagementOptions
Passkey management mutation settings (delete, rename).
PasskeyOptions
Passkey plugin settings.
PasskeyRateLimit
Rate limit settings for passkey ceremony endpoints (challenge generation and verification).
PasskeyRegistrationOptions
PasskeyRegistrationStart
PasskeyRegistrationUser
User identity used for passkey registration.
PasskeySchemaOptions
Database schema naming overrides for the passkey model.
RegistrationWebAuthnOptions
WebAuthn option customizations resolved for one registration request.
ResolveRegistrationUserInput
VerifiedAuthentication
VerifiedPasskeyCredential
WebAuthnConfig

Enums§

AuthenticatorAttachment
Browser authenticator attachment hint.
ResidentKeyRequirement
Resident key preference used in registration options.
UserVerificationRequirement
User verification preference used in WebAuthn options.

Constants§

PASSKEY_ERROR_CODES
RATE_LIMITED_CEREMONY_PATHS
Ceremony endpoints that mint or consume WebAuthn challenges.
UPSTREAM_PLUGIN_ID

Functions§

passkey
Build the server-side passkey plugin.