Skip to content

feat(webauthn): populate authenticatorAttachment in JSON responses#299

Merged
AlfioEmanueleFresta merged 1 commit into
masterfrom
feat/authenticator-attachment
Jul 14, 2026
Merged

feat(webauthn): populate authenticatorAttachment in JSON responses#299
AlfioEmanueleFresta merged 1 commit into
masterfrom
feat/authenticator-attachment

Conversation

@AlfioEmanueleFresta

@AlfioEmanueleFresta AlfioEmanueleFresta commented Jul 14, 2026

Copy link
Copy Markdown
Member

authenticatorAttachment was hardcoded to None on both the registration and authentication JSON responses, so consumers had to patch the JSON themselves afterwards. It is now derived from the transport the ceremony ran on.

Assertions gain a transport field, stamped in webauthn_get_assertion so that both the FIDO2 and U2F paths are covered, mirroring what makeCredential already does. libwebauthn only drives roaming authenticators, so every transport maps to cross-platform, and an unknown transport omits the field.

The transports half of #159 landed in #282, so this completes it.

Closes #159.

#159)

The registration `transports` array already folds getInfo 0x09 with the
ceremony transport, but `authenticatorAttachment` was still hardcoded to
`None` for both RegistrationResponseJSON and AuthenticationResponseJSON.

Derive it from the channel-stamped ceremony transport via a new
`Transport::authenticator_attachment()`. libwebauthn only drives roaming
authenticators, so every transport maps to "cross-platform"; an unknown
transport omits the field. Assertions gain a `transport` field stamped in
`webauthn_get_assertion`, mirroring how MakeCredential is already stamped.

The existing large-blob end-to-end tests (single- and multi-assertion, over
MockChannel) now assert the ceremony transport is stamped onto every
assertion, covering the wiring in addition to the to_idl_model mapping.
@AlfioEmanueleFresta
AlfioEmanueleFresta merged commit cd5b6c2 into master Jul 14, 2026
8 checks passed
@AlfioEmanueleFresta
AlfioEmanueleFresta deleted the feat/authenticator-attachment branch July 14, 2026 18:28
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.

Response serialization should support transports and authenticatorAttachment

1 participant