Skip to content

feat: aaguid lookup & authenticator metadata#5

Open
o-az wants to merge 9 commits intomainfrom
o-az/webauthn-aaguid-metadata
Open

feat: aaguid lookup & authenticator metadata#5
o-az wants to merge 9 commits intomainfrom
o-az/webauthn-aaguid-metadata

Conversation

@o-az
Copy link
Copy Markdown
Member

@o-az o-az commented Apr 7, 2026

0509d8a79565a747741918801956620c30d58649276fd2f4b58117614e8b354a
  • Add Aaguid.extract to parse AAGUID from attestation objects
  • Add Aaguid.lookup to resolve authenticator metadata (name, icons) from the passkey-authenticator-aaguids registry
  • Include aaguid in Registration.verify response (optional — undefined when not decodable)
  • Update Hono example to display authenticator name & icon via AAGUID lookup

Logic:

webauthx always extracts the raw aaguid synchronously during Registration.verify(...), and Aaguid.lookup({ id, remoteList?, fetchFn?, cache? }) optionally resolves friendly metadata by fetching a remote registry. The lookup uses remoteList if provided, otherwise defaults to the GitHub combined_aaguid.json URL, uses fetchFn if provided or globalThis.fetch otherwise, normalizes AAGUID keys to lowercase plus upstream snake_case/camelCase icon fields, and caches the fetched registry in a module-level in-memory Map keyed by URL so later lookups reuse the same cached result or in-flight promise; cache: false bypasses that, and failed fetches are evicted so retries can succeed.

Aaguid.lookup:

import { Aaguid, Registration } from 'webauthx/server'

// After registration verification
const result = Registration.verify(credential, { challenge, origin, rpId })

// Extract authenticator metadata from AAGUID
if (result.aaguid) {
  const authenticator = await Aaguid.lookup({ id: result.aaguid })
  // ^? { name: 'iCloud Keychain', iconLight: 'https://...', iconDark: 'https://...' } | null
}

// Store alongside the credential
await db.saveCredential({
  id: result.credential.id,
  publicKey: result.credential.publicKey,
  aaguid: result.aaguid,
})

Aaguid.extract:

import { Aaguid } from 'webauthx/server'

// Extract AAGUID from a serialized registration credential
const aaguid = Aaguid.extract(credential)
// ^? string | undefined
// e.g. '08987058-cadc-4b81-b6e1-30de50dcbe96'

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new bot commented Apr 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/webauthx@5

commit: 768c3df

@socket-security
Copy link
Copy Markdown

socket-security bot commented Apr 7, 2026

@o-az o-az requested a review from jxom April 7, 2026 07:46
o-az added 7 commits April 10, 2026 10:19
- Add `Aaguid.extract` to parse AAGUID from attestation objects
- Add `Aaguid.lookup` to resolve authenticator metadata (name, icons) from the passkey-authenticator-aaguids registry
- Include `aaguid` in `Registration.verify` response (optional — `undefined` when not decodable)
- Update Hono example to display authenticator name & icon via AAGUID lookup
@o-az o-az force-pushed the o-az/webauthn-aaguid-metadata branch from e653670 to f5215db Compare April 10, 2026 17:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant