webauthn not working

Asked

Viewed 18 times

0

I am trying to use (and learning) webauthn on my website, but the "Platform" authentication method does not work, returning the error Domexception: The Operation either timed out or was not allowed.

When I change the method to "cross-Platform", it works.

My code:

let credential = navigator.credentials.create({
  publicKey: {
    challenge: Uint8Array.from(
      "3bn83gh8negn8hs8",
      c => c.charCodeAt(0)
    ),
    rp: {
      name: "nome do site ",
      id: "url do site",
    },
    user: {
      id: Uint8Array.from(
        "UZSL85T9AFC",
        c => c.charCodeAt(0)
      ),
      name: "email",
      displayName: "nome",
    },
    pubKeyCredParams: [{
      alg: -7,
      type: "public-key"
    }],
    authenticatorSelection: {
      authenticatorAttachment: "platform",
      userVerification: "preferred"
    },
    timeout: 30000,
    attestation: "direct"
  }
});

I use Edge 87.0.664.24

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.