Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow non-JSON assertions/attestations #19

Open
lorenz opened this issue Jan 6, 2021 · 0 comments
Open

Allow non-JSON assertions/attestations #19

lorenz opened this issue Jan 6, 2021 · 0 comments

Comments

@lorenz
Copy link

lorenz commented Jan 6, 2021

Currently the parsing of credential data is wrapped up within UmarshalJSON, which is inconvenient if one uses a binary encoding (I use gRPC/Protobuf) to communicate with the client. The Webauthn Browser API already exposes the values as ArrayBuffers, which can be directly encoded by Protobuf.

Something like this (adapted from the existing interface in UnmarshalJSON) could work:

type RawAuthenticatorAttestationResponse struct {
  ClientDataJSON    []byte  // JSON-serialized client data passed to the authenticator by the client.
  AttestationObject []byte `json:"attestationObject"` // Attestation object, containing authenticator data and attestation statement.
}
type RawPublicKeyCredential struct {
  ID       []byte // Credential ID
  Response RawAuthenticatorAttestationResponse  // Authenticator's response to client's request to create a public key credential.
  Type     string                              `json:"type"`            // "public-key"
}

All []byte values would already be in binary.

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

No branches or pull requests

1 participant