Skip to content
This repository has been archived by the owner on Dec 5, 2022. It is now read-only.

feat: parse transports data from credential attestation #130

Conversation

james-d-elliott
Copy link
Contributor

@james-d-elliott james-d-elliott commented Feb 18, 2022

This parses the credential attestation and obtains the transports if provided. This must be manually done at the client level using AuthenticatorAttestationResponse.getTransports(). See https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse. As per the spec this allows any values from the client. See https://w3c.github.io/webauthn/#dom-authenticatorattestationresponse-transports-slot.

@james-d-elliott
Copy link
Contributor Author

For reference this is the JSON property the major browser libraries use from what I can tell.

@james-d-elliott
Copy link
Contributor Author

Just noticed this ignores any unknown value, however the spec mentions the following:

This internal slot contains a sequence of zero or more unique DOMStrings in lexicographical order. These values are the transports that the authenticator is believed to support, or an empty sequence if the information is unavailable. The values SHOULD be members of AuthenticatorTransport but Relying Parties SHOULD accept and store unknown values.

Hence I'm updating it to include any values sent from the client.

@james-d-elliott james-d-elliott force-pushed the feat-credential-transports branch from 41bf170 to 500e4ff Compare February 18, 2022 11:21
This parses the credential attestation and obtains the transports if provided. This must be manually done at the client level using AuthenticatorAttestationResponse.getTransports(). See https://developer.mozilla.org/en-US/docs/Web/API/AuthenticatorAttestationResponse. As per the spec this allows any values from the client. See https://w3c.github.io/webauthn/#dom-authenticatorattestationresponse-transports-slot.
@james-d-elliott james-d-elliott force-pushed the feat-credential-transports branch from 500e4ff to cb7bf80 Compare February 18, 2022 11:23
@james-d-elliott
Copy link
Contributor Author

james-d-elliott commented Feb 18, 2022

Actually this is kind of interesting. Maybe the placement of transports is wrong. It looks like based on the indent that it should be part of the publicKey.response object. While the value is an internal slot, it seems kind of strange that the layout would change as drastically as this. Interested to hear some thoughts specifically about this topic prior to merging.

firefox_BRn5dnM1LA

@james-d-elliott james-d-elliott marked this pull request as draft February 18, 2022 13:47
@MasterKale
Copy link
Collaborator

@james-d-elliott Apologies, but I'm closing out this PR as this project is now deprecated.

@MasterKale MasterKale closed this Dec 5, 2022
@james-d-elliott james-d-elliott deleted the feat-credential-transports branch December 6, 2022 06:45
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants