The WebAuthnIDLResponse::to_inner_model() implementations for MakeCredentialResponse and Assertion currently cannot populate two fields that are known at the transport layer:
transports (MakeCredential only) - hardcoded to Vec::new() in to_inner_model()
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
The
WebAuthnIDLResponse::to_inner_model()implementations forMakeCredentialResponseandAssertioncurrently cannot populate two fields that are known at the transport layer:transports(MakeCredential only) - hardcoded toVec::new()into_inner_model()authenticator_attachment- hardcoded toNonefor both response typesCurrent workaround
Consumers (like credentialsd) must modify the returned
RegistrationResponseJSON/AuthenticationResponseJSONafter callingto_inner_model():Proposed Solution
AuthenticatorTransportenum)UsbTransport,NfcTransport, etc.) could report their transport type, andauthenticator_attachmentcould be derived from the authenticator info.References
AuthenticatorAttestationResponseJSON.transportsPublicKeyCredentialJSON.authenticatorAttachment