Skip to content

Response serialization should support transports and authenticatorAttachment #159

@AlfioEmanueleFresta

Description

@AlfioEmanueleFresta

The WebAuthnIDLResponse::to_inner_model() implementations for MakeCredentialResponse and Assertion currently cannot populate two fields that are known at the transport layer:

  1. transports (MakeCredential only) - hardcoded to Vec::new() in to_inner_model()
  2. authenticator_attachment - hardcoded to None for both response types

Current workaround

Consumers (like credentialsd) must modify the returned RegistrationResponseJSON / AuthenticationResponseJSON after calling to_inner_model():

let mut registration_json = response.ctap.to_inner_model(request)?;
registration_json.response.transports = transports_from_transport_layer.clone();
registration_json.authenticator_attachment = Some(attachment_modality.clone());

Proposed Solution

  • libwebauthn already has a concept of transports (AuthenticatorTransport enum)
  • The transport implementations (UsbTransport, NfcTransport, etc.) could report their transport type, and authenticator_attachment could be derived from the authenticator info.
  • The attachment modality ("platform" vs "cross-platform") can be determined based on the transport used
  • This information is available during the WebAuthn operation but not currently captured in the response

References

  • WebAuthn Level 3 spec: AuthenticatorAttestationResponseJSON.transports
  • WebAuthn Level 3 spec: PublicKeyCredentialJSON.authenticatorAttachment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions