@firebase-web-authn/types
v10.3.7
Published
A Firebase Extension for authentication with WebAuthn passkeys.
Downloads
73
Readme
@firebase-web-authn/types
A Firebase Extension for authentication with WebAuthn passkeys.
This package contains types and interfaces used internally by FirebaseWebAuthn and for implementing it in a secure context.
WebAuthnUserCredential
Information about the public key credential associated with the user
import { WebAuthnUserCredential } from "@firebase-web-authn/types";
interface WebAuthnUserCredential {
"authenticatorAttachment": AuthenticatorAttachment, // The AuthenticatorAttachment associated with the credential.
"backedUp": boolean, // Whether the private key has been backed up successfully.
"counter": number, // Updated automatically by some browsers to help prevent replay attacks.
"id": Uint8Array, // ID associated with the credential.
"publicKey": Uint8Array, // Public key associated with the credential.
}
WebAuthnUserCredentialFactor
The authentication factor associated with the credential.
import { WebAuthnUserCredentialFactor } from "@firebase-web-authn/types";
type WebAuthnUserCredentialFactor = "first" | "second";
WebAuthnProcess
The WebAuthn process associated with operations and related cryptographic challenges.
import { WebAuthnProcess } from "@firebase-web-authn/types";
type WebAuthnProcess = "authentication" | "reauthentication" | "registration";
WebAuthnUserDocument
Document in the users
collection of the ext-firebase-web-authn
Firestore Database. This should not have read or write access from users.
import { WebAuthnUserDocument } from "@firebase-web-authn/types";
interface WebAuthnUserDocument {
"challenge"?: string, // Only present between operations and cleaned up if the user cancels.
"credentials"?: { // An object of "first" and "second" WebAuthnUserCredentials with either being null if not found.
[key in WebAuthnUserCredentialFactor]: WebAuthnUserCredential | null
},
"lastCredentialUsed"?: WebAuthnUserCredentialFactor, // The last credential successfully authenticated given as WebAuthnUserCredentialFactor.
"lastPresent"?: Timestamp, // Automatically updated on successful operations.
"lastVerified"?: Timestamp, // Automatically updated on successful operations that verified the user with biometrics.
"lastWebAuthnProcess"?: WebAuthnProcess, // The last WebAuthnProcess successfully completed by the user..
}