@simplewebauthn/server@13.3.2Built and signed on GitHub ActionsBuilt and signed on GitHub Actions
SimpleWebAuthn for Servers
Classes
An implementation of MetadataService that can download and parse BLOBs, and support on-demand
requesting and caching of individual metadata statements.
- downloadBlob(cachedMDS: CachedMDS)
Download and process the latest BLOB from MDS
- getStatement(aaguid: string | Uint8Array_): Promise<MetadataStatement | undefined>No documentation available
- initialize(opts?: { mdsServers?: string[]; statements?: MetadataStatement[]; verificationMode?: VerificationMode; }): Promise<void>No documentation available
- mdsCache: { [url: string]: CachedMDS; }No documentation available
- pauseUntilReady(): Promise<void>
A helper method to pause execution until the service is ready
- setState(newState: SERVICE_STATE): void
Report service status on change
- state: SERVICE_STATENo documentation available
- statementCache: { [aaguid: string]: CachedBLOBEntry; }No documentation available
- verificationMode: VerificationModeNo documentation available
- verifyBlob(): Promise<void>blob: string,cachedMDS: CachedMDS
Verify and process the MDS metadata blob
Functions
Prepare a value to pass into navigator.credentials.get(...) for authenticator authentication
Prepare a value to pass into navigator.credentials.create(...) for authenticator registration
Verify that the user has legitimately completed the authentication process
Verify that the user has legitimately completed the registration process
Interfaces
The value returned from navigator.credentials.get()
- response: AuthenticatorAssertionResponseNo documentation available
- appid: stringNo documentation available
- credProps: booleanNo documentation available
- hmacCreateSecret: booleanNo documentation available
- minPinLength: booleanNo documentation available
- appid: booleanNo documentation available
- credProps: CredentialPropertiesOutputNo documentation available
- hmacCreateSecret: booleanNo documentation available
A slightly-modified AuthenticationCredential to simplify working with ArrayBuffers that are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
- authenticatorAttachment: AuthenticatorAttachmentNo documentation available
- clientExtensionResults: AuthenticationExtensionsClientOutputsNo documentation available
- id: Base64URLStringNo documentation available
- rawId: Base64URLStringNo documentation available
- response: AuthenticatorAssertionResponseJSONNo documentation available
- type: PublicKeyCredentialTypeNo documentation available
Available only in secure contexts.
- authenticatorData: ArrayBuffer
- signature: ArrayBuffer
- userHandle: ArrayBuffer | null
A slightly-modified AuthenticatorAssertionResponse to simplify working with ArrayBuffers that are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
- authenticatorData: Base64URLStringNo documentation available
- clientDataJSON: Base64URLStringNo documentation available
- signature: Base64URLStringNo documentation available
- userHandle: Base64URLStringNo documentation available
Available only in secure contexts.
- attestationObject: ArrayBuffer
- getAuthenticatorData(): ArrayBuffer
- getPublicKey(): ArrayBuffer | null
- getPublicKeyAlgorithm(): COSEAlgorithmIdentifier
- getTransports(): string[]
AuthenticatorAttestationResponse in TypeScript's DOM lib is outdated (up through v3.9.7). Maintain an augmented version here so we can implement additional properties as the WebAuthn spec evolves.
- getTransports(): AuthenticatorTransportFuture[]No documentation available
A slightly-modified AuthenticatorAttestationResponse to simplify working with ArrayBuffers that are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
- attestationObject: Base64URLStringNo documentation available
- authenticatorData: Base64URLStringNo documentation available
- clientDataJSON: Base64URLStringNo documentation available
- publicKey: Base64URLStringNo documentation available
- publicKeyAlgorithm: COSEAlgorithmIdentifierNo documentation available
- transports: AuthenticatorTransportFuture[]No documentation available
- authenticatorAttachment: AuthenticatorAttachmentNo documentation available
- requireResidentKey: booleanNo documentation available
- residentKey: ResidentKeyRequirementNo documentation available
- userVerification: UserVerificationRequirementNo documentation available
Basic cryptography features available in the current context. It allows access to a cryptographically strong random number generator and to cryptographic primitives.
- getRandomValues<T extends ArrayBufferView | null>(array: T): T
- randomUUID(): `${string}-${string}-${string}-${string}-${string}`
Available only in secure contexts.
- subtle: SubtleCrypto
Available only in secure contexts.
- getStatement(aaguid: string | Uint8Array): Promise<MetadataStatement | undefined>
Get a metadata statement for a given AAGUID.
- initialize(opts?: { mdsServers?: string[]; statements?: MetadataStatement[]; verificationMode?: VerificationMode; }): Promise<void>
Prepare the service to handle remote MDS servers and/or cache local metadata statements.
Available only in secure contexts.
- authenticatorAttachment: string | null
- getClientExtensionResults(): AuthenticationExtensionsClientOutputs
- rawId: ArrayBuffer
- response: AuthenticatorResponse
- attestation: AttestationConveyancePreferenceNo documentation available
- authenticatorSelection: AuthenticatorSelectionCriteriaNo documentation available
- challenge: BufferSourceNo documentation available
- excludeCredentials: PublicKeyCredentialDescriptor[]No documentation available
- extensions: AuthenticationExtensionsClientInputsNo documentation available
- pubKeyCredParams: PublicKeyCredentialParameters[]No documentation available
- rp: PublicKeyCredentialRpEntityNo documentation available
- timeout: numberNo documentation available
- user: PublicKeyCredentialUserEntityNo documentation available
A variant of PublicKeyCredentialCreationOptions suitable for JSON transmission to the browser to (eventually) get passed into navigator.credentials.create(...) in the browser.
- attestation: AttestationConveyancePreferenceNo documentation available
- attestationFormats: AttestationFormat[]No documentation available
- authenticatorSelection: AuthenticatorSelectionCriteriaNo documentation available
- challenge: Base64URLStringNo documentation available
- excludeCredentials: PublicKeyCredentialDescriptorJSON[]No documentation available
- extensions: AuthenticationExtensionsClientInputsNo documentation available
- hints: PublicKeyCredentialHint[]No documentation available
- pubKeyCredParams: PublicKeyCredentialParameters[]No documentation available
- rp: PublicKeyCredentialRpEntityNo documentation available
- timeout: numberNo documentation available
- user: PublicKeyCredentialUserEntityJSONNo documentation available
- id: BufferSourceNo documentation available
- transports: AuthenticatorTransport[]No documentation available
- type: PublicKeyCredentialTypeNo documentation available
A super class of TypeScript's PublicKeyCredentialDescriptor that knows about the latest
transports. Should eventually be replaced by TypeScript's when TypeScript gets updated to
know about it (sometime after 4.6.3)
- transports: AuthenticatorTransportFuture[]No documentation available
- id: Base64URLStringNo documentation available
- transports: AuthenticatorTransportFuture[]No documentation available
- type: PublicKeyCredentialTypeNo documentation available
A super class of TypeScript's PublicKeyCredential that knows about upcoming WebAuthn features
- isConditionalMediationAvailable(): Promise<boolean>No documentation available
- parseCreationOptionsFromJSON(options: PublicKeyCredentialCreationOptionsJSON): PublicKeyCredentialCreationOptionsNo documentation available
- parseRequestOptionsFromJSON(options: PublicKeyCredentialRequestOptionsJSON): PublicKeyCredentialRequestOptionsNo documentation available
- toJSON(): PublicKeyCredentialJSONNo documentation available
- type: PublicKeyCredentialTypeNo documentation available
- allowCredentials: PublicKeyCredentialDescriptor[]No documentation available
- challenge: BufferSourceNo documentation available
- extensions: AuthenticationExtensionsClientInputsNo documentation available
- rpId: stringNo documentation available
- timeout: numberNo documentation available
- userVerification: UserVerificationRequirementNo documentation available
A variant of PublicKeyCredentialRequestOptions suitable for JSON transmission to the browser to (eventually) get passed into navigator.credentials.get(...) in the browser.
- allowCredentials: PublicKeyCredentialDescriptorJSON[]No documentation available
- challenge: Base64URLStringNo documentation available
- extensions: AuthenticationExtensionsClientInputsNo documentation available
- hints: PublicKeyCredentialHint[]No documentation available
- rpId: stringNo documentation available
- timeout: numberNo documentation available
- userVerification: UserVerificationRequirementNo documentation available
- id: stringNo documentation available
- displayName: stringNo documentation available
- id: BufferSourceNo documentation available
- displayName: stringNo documentation available
- id: stringNo documentation available
- name: stringNo documentation available
The value returned from navigator.credentials.create()
- response: AuthenticatorAttestationResponseFutureNo documentation available
A slightly-modified RegistrationCredential to simplify working with ArrayBuffers that are Base64URL-encoded in the browser so that they can be sent as JSON to the server.
- authenticatorAttachment: AuthenticatorAttachmentNo documentation available
- clientExtensionResults: AuthenticationExtensionsClientOutputsNo documentation available
- id: Base64URLStringNo documentation available
- rawId: Base64URLStringNo documentation available
- response: AuthenticatorAttestationResponseJSONNo documentation available
- type: PublicKeyCredentialTypeNo documentation available
- getRootCertificates(opts: { identifier: RootCertIdentifier; }): string[]
Get any registered root certificates for the specified attestation format
- setRootCertificates(opts: { identifier: RootCertIdentifier; certificates: (Uint8Array_ | string)[]; }): void
Set potential root certificates for attestation formats that use them. Root certs will be tried one-by-one when validating a certificate path.
Type Aliases
| "ecc_x962_der"
| "rsa_2048_raw"
| "rsa_2048_der"
| "cose"
langCode -> "en-US", "ja-JP", etc...
| "external"
| "wired"
| "wireless"
| "nfc"
| "bluetooth"
| "network"
| "ready"
| "wifi_direct"
| "basic_surrogate"
| "ecdaa"
| "attca"
| "anonca"
| "none"
| "packed"
| "android-safetynet"
| "android-key"
| "tpm"
| "apple"
| "none"
Values for an attestation object's fmt
Values passed to all attestation format verifiers, from which they are free to use as they please
- aaguid: Uint8Array_No documentation available
- attStmt: AttestationStatementNo documentation available
- attestationSafetyNetEnforceCTSCheck: booleanNo documentation available
- authData: Uint8Array_No documentation available
- clientDataHash: Uint8Array_No documentation available
- credentialID: Uint8Array_No documentation available
- credentialPublicKey: Uint8Array_No documentation available
- rootCertificates: string[]No documentation available
- rpIdHash: Uint8Array_No documentation available
- verifyTimestampMS: booleanNo documentation available
- aaguid: stringNo documentation available
- algorithms: { type: "public-key"; alg: number; }[]No documentation available
- extensions: string[]No documentation available
- maxMsgSize: numberNo documentation available
- options: { plat?: boolean; rk?: boolean; clientPin?: boolean; up?: boolean; uv?: boolean; }No documentation available
- pinProtocols: number[]No documentation available
- versions: ("FIDO_2_0" | "U2F_V2")[]No documentation available
| "FIDO_CERTIFIED"
| "USER_VERIFICATION_BYPASS"
| "ATTESTATION_KEY_COMPROMISE"
| "USER_KEY_REMOTE_COMPROMISE"
| "USER_KEY_PHYSICAL_COMPROMISE"
| "UPDATE_AVAILABLE"
| "REVOKED"
| "SELF_ASSERTION_SUBMITTED"
| "FIDO_CERTIFIED_L1"
| "FIDO_CERTIFIED_L1plus"
| "FIDO_CERTIFIED_L2"
| "FIDO_CERTIFIED_L2plus"
| "FIDO_CERTIFIED_L3"
| "FIDO_CERTIFIED_L3plus"
| "cable"
| "hybrid"
| "internal"
| "nfc"
| "smart-card"
| "usb"
A super class of TypeScript's AuthenticatorTransport that includes support for the latest
transports. Should eventually be replaced by TypeScript's when TypeScript gets updated to
know about it (sometime after 4.6.3)
An attempt to communicate that this isn't just any string, but a Base64URL-encoded string
- blockSlowdown: numberNo documentation available
- maxRetries: numberNo documentation available
- maxTemplates: numberNo documentation available
- selfAttestedFAR: numberNo documentation available
- selfAttestedFRR: numberNo documentation available
- certLevel: numberNo documentation available
- certificateNumber: stringNo documentation available
- certificationDescriptor: stringNo documentation available
- certificationPolicyVersion: stringNo documentation available
- certificationRequirementsVersion: stringNo documentation available
- effectiveDate: stringNo documentation available
- modality: UserVerifyNo documentation available
Types defined in the FIDO Metadata Statement spec
- base: numberNo documentation available
- blockSlowdown: numberNo documentation available
- maxRetries: numberNo documentation available
- minLength: numberNo documentation available
The two types of credentials as defined by bit 3 ("Backup Eligibility") in authenticator data:
- bitDepth: numberNo documentation available
- colorType: numberNo documentation available
- compression: numberNo documentation available
- filter: numberNo documentation available
- height: numberNo documentation available
- interlace: numberNo documentation available
- plte: rgbPaletteEntry[]No documentation available
- width: numberNo documentation available
- data: stringNo documentation available
- fail_if_unknown: booleanNo documentation available
- id: stringNo documentation available
- tag: numberNo documentation available
| "hardware"
| "tee"
| "secure_element"
| "remote_handle"
- entries: MetadataBLOBPayloadEntry[]No documentation available
- legalHeader: stringNo documentation available
- nextUpdate: stringNo documentation available
- no: numberNo documentation available
- aaguid: stringNo documentation available
- aaid: stringNo documentation available
- attestationCertificateKeyIdentifiers: string[]No documentation available
- biometricStatusReports: BiometricStatusReport[]No documentation available
- metadataStatement: MetadataStatementNo documentation available
- rogueListHash: stringNo documentation available
- rogueListURL: stringNo documentation available
- statusReports: StatusReport[]No documentation available
- timeOfLastStatusChange: stringNo documentation available
- aaguid: stringNo documentation available
- aaid: stringNo documentation available
- alternativeDescriptions: AlternativeDescriptionsNo documentation available
- attachmentHint: AttachmentHint[]No documentation available
- attestationCertificateKeyIdentifiers: string[]No documentation available
- attestationRootCertificates: string[]No documentation available
- attestationTypes: Attestation[]No documentation available
- authenticationAlgorithms: AlgSign[]No documentation available
- authenticatorGetInfo: AuthenticatorGetInfoNo documentation available
- authenticatorVersion: numberNo documentation available
- cryptoStrength: numberNo documentation available
- description: stringNo documentation available
- ecdaaTrustAnchors: EcdaaTrustAnchor[]No documentation available
- icon: stringNo documentation available
- isFreshUserVerificationRequired: booleanNo documentation available
- isKeyRestricted: booleanNo documentation available
- keyProtection: KeyProtection[]No documentation available
- legalHeader: stringNo documentation available
- matcherProtection: MatcherProtection[]No documentation available
- protocolFamily: stringNo documentation available
- publicKeyAlgAndEncodings: AlgKey[]No documentation available
- schema: numberNo documentation available
- supportedExtensions: ExtensionDescriptor[]No documentation available
- tcDisplay: TransactionConfirmationDisplay[]No documentation available
- tcDisplayContentType: stringNo documentation available
- tcDisplayPNGCharacteristics: DisplayPNGCharacteristicsDescriptor[]No documentation available
- upv: Version[]No documentation available
- userVerificationDetails: VerificationMethodANDCombinations[]No documentation available
- blockSlowdown: numberNo documentation available
- maxRetries: numberNo documentation available
- minComplexity: numberNo documentation available
Categories of authenticators that Relying Parties can pass along to browsers during registration. Browsers that understand these values can optimize their modal experience to start the user off in a particular registration flow:
- authenticatorVersion: numberNo documentation available
- certificate: stringNo documentation available
- certificateNumber: stringNo documentation available
- certificationDescriptor: stringNo documentation available
- certificationPolicyVersion: stringNo documentation available
- certificationRequirementsVersion: stringNo documentation available
- effectiveDate: stringNo documentation available
- status: AuthenticatorStatusNo documentation available
- url: stringNo documentation available
| "privileged_software"
| "tee"
| "hardware"
| "remote"
TRANSACTION_CONFIRMATION_DISPLAY https://fidoalliance.org/specs/common-specs/fido-registry-v2.2-ps-20220523.html#transaction-confirmation-display-types
Equivalent to Uint8Array before TypeScript 5.7, and Uint8Array<ArrayBuffer> in TypeScript 5.7
and beyond.
| "fingerprint_internal"
| "passcode_internal"
| "voiceprint_internal"
| "faceprint_internal"
| "location_internal"
| "eyeprint_internal"
| "pattern_internal"
| "handprint_internal"
| "passcode_external"
| "pattern_external"
| "none"
| "all"
- baDesc: BiometricAccuracyDescriptorNo documentation available
- caDesc: CodeAccuracyDescriptorNo documentation available
- paDesc: PatternAccuracyDescriptorNo documentation available
- userVerificationMethod: UserVerifyNo documentation available
Allow MetadataService to accommodate unregistered AAGUIDs ("permissive"), or only allow
registered AAGUIDs ("strict"). Currently primarily impacts how getStatement() operates
Result of authentication verification
- authenticationInfo: { credentialID: Base64URLString; newCounter: number; userVerified: boolean; credentialDeviceType: CredentialDeviceType; credentialBackedUp: boolean; origin: string; rpID: string; authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs; }No documentation available
- verified: booleanNo documentation available
| { verified: true; registrationInfo: { fmt: AttestationFormat; aaguid: string; credential: WebAuthnCredential; credentialType: "public-key"; attestationObject: Uint8Array_; userVerified: boolean; credentialDeviceType: CredentialDeviceType; credentialBackedUp: boolean; origin: string; rpID?: string; authenticatorExtensionResults?: AuthenticationExtensionsAuthenticatorOutputs; }; }
Result of registration verification
Configurable options when calling verifyAuthenticationResponse()
Configurable options when calling verifyRegistrationResponse()
Public key credential information needed to verify authentication responses
- counter: numberNo documentation available
- id: Base64URLStringNo documentation available
- publicKey: Uint8Array_No documentation available
- transports: AuthenticatorTransportFuture[]No documentation available
Variables
Supported crypto algo identifiers See https://w3c.github.io/webauthn/#sctn-alg-identifier and https://www.iana.org/assignments/cose/cose.xhtml#algorithms