Skip to content

Commit

Permalink
Explicitly pass WebAuthn credential properties (#6975)
Browse files Browse the repository at this point in the history
  • Loading branch information
scotttrinh authored and msullivan committed Mar 7, 2024
1 parent 194f5e4 commit 7572e08
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions edb/server/protocol/auth_ext/_static/webauthn-authenticate.js
Expand Up @@ -150,10 +150,12 @@ async function authenticateAssertion(props) {
// Assertion includes raw bytes, so need to be encoded as base64url
// for transmission
const encodedAssertion = {
...props.assertion,
type: props.assertion.type,
id: props.assertion.id,
authenticatorAttachment: props.assertion.authenticatorAttachment,
clientExtensionResults: props.assertion.getClientExtensionResults(),
rawId: encodeBase64Url(new Uint8Array(props.assertion.rawId)),
response: {
...props.assertion.response,
authenticatorData: encodeBase64Url(
new Uint8Array(props.assertion.response.authenticatorData)
),
Expand Down
6 changes: 4 additions & 2 deletions edb/server/protocol/auth_ext/_static/webauthn-register.js
Expand Up @@ -164,10 +164,12 @@ async function registerCredentials(props) {
// Credentials include raw bytes, so need to be encoded as base64url
// for transmission
const encodedCredentials = {
...props.credentials,
type: props.credentials.type,
authenticatorAttachment: props.credentials.authenticatorAttachment,
clientExtensionResults: props.credentials.getClientExtensionResults(),
id: props.credentials.id,
rawId: encodeBase64Url(new Uint8Array(props.credentials.rawId)),
response: {
...props.credentials.response,
attestationObject: encodeBase64Url(
new Uint8Array(props.credentials.response.attestationObject)
),
Expand Down

0 comments on commit 7572e08

Please sign in to comment.