Skip to content

Instantly share code, notes, and snippets.

@anandanand84
Created August 15, 2020 20:10
Show Gist options
  • Save anandanand84/538dd42d1eb4233c38ee45eaef21b034 to your computer and use it in GitHub Desktop.
Save anandanand84/538dd42d1eb4233c38ee45eaef21b034 to your computer and use it in GitHub Desktop.
var publicKeyCredentialCreationOptions = {
challenge: Uint8Array.from(
"randomStringFromServer", c => c.charCodeAt(0)),
rp: {
name: "dev",
id: "developers.yubico.com",
},
user: {
id: Uint8Array.from(
"UZSL85T9AFC", c => c.charCodeAt(0)),
name: "lee@webauthn.guide",
displayName: "Lee",
},
pubKeyCredParams: [{alg: -7, type: "public-key"}],
authenticatorSelection: {
authenticatorAttachment: "cross-platform",
},
timeout: 60000,
attestation: "direct"
};
navigator.credentials.create({
publicKey: publicKeyCredentialCreationOptions
}).then(console.log);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment