@firebase-web-authn/types
TypeScript icon, indicating that this package has built-in type declarations

10.3.7 • Public • Published

@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.

FirebaseWebAuthn version Firebase Admin SDK version

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..
}

More packages

Readme

Keywords

none

Package Sidebar

Install

npm i @firebase-web-authn/types

Weekly Downloads

16

Version

10.3.7

License

Apache-2.0

Unpacked Size

19.2 kB

Total Files

23

Last publish

Collaborators

  • gavinsawyer