Skip to main content

Crate openauth_passkey

Crate openauth_passkey 

Source
Expand description

Server-side passkey plugin for OpenAuth.

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

use openauth_core::options::OpenAuthOptions;
use openauth_passkey::{passkey, PasskeyOptions};

let options = OpenAuthOptions::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 OpenAuth’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
PasskeyAuthenticationStart
PasskeyOptions
Passkey plugin settings.
PasskeyRegistrationOptions
PasskeyRegistrationStart
PasskeyRegistrationUser
User identity used for passkey registration.
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
UPSTREAM_PLUGIN_ID

Traits§

PasskeyWebAuthnBackend

Functions§

passkey
Build the server-side passkey plugin.