Skip to content

Instantly share code, notes, and snippets.

@MeiyappanKannappa
Created March 15, 2024 03:22
Show Gist options
  • Select an option

  • Save MeiyappanKannappa/587e57db99f83a7a49127b20aa64cdb6 to your computer and use it in GitHub Desktop.

Select an option

Save MeiyappanKannappa/587e57db99f83a7a49127b20aa64cdb6 to your computer and use it in GitHub Desktop.
// Simulate the server response with login options
const loginOptions = {
challenge: new Uint8Array(32),
rpId: 'example.com'
};
// Use the WebAuthn API to get a credential for login
const credential = await navigator.credentials.get({ publicKey: loginOptions });
// Simulate sending the credential to the server for verification
console.log('Credential:', credential);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment