-
{ id: "nZOlyXf57erlQbudIIuOrQEdRUs", rawId: [ArrayBuffer], response: { attestationObject: [ArrayBuffer], clientDataJSON: [ArrayBuffer], }, type: "public-key", }
-
const body = JSON.stringify(attestation); const response = await fetch(`/register`, { method: "POST", body, });
-
const { credentialId } = await response.json(); localStorage.setItem('credentialId', credentialId);
-
How to login with platform key:
- Checking if we have saved Сredential Id
- Request challenge from the server
-
How to login with platform key:
- Pass challenge to the platform and getting PublicKeyCredential back
- Send PublicKeyCredential to the server, so we can check the challenge
-
const credentialId = localStorage.getItem('credentialId'); if (credentialId === null) return;
-
const response = await fetch( '/challenge/login', { method: 'POST' } ); const options = await response.json();
-
const { challenge } = options; const credentialId = localStorage.getItem('credentialId'); options.allowCredentials = [{ type: "public-key", id: toBuffer(credentialId), }];
-
const credential = await navigator.credentials.get({ publicKey: options });
-
-
{ id: "FtjWT4fIT9…zs2LRxuG5fBRj9bA", rawId: [ArrayBuffer], response: { authenticatorData: [ArrayBuffer], clientDataJSON: [ArrayBuffer], signature: [ArrayBuffer], userHandle: null, }, type: "public-key", }
-
const body = JSON.stringify(authenticator); await fetch('/login', { method: "POST", body });
-
-
WebAuthn demo application
-
Emulate Authenticators and Debug WebAuthn in Chrome DevTools
-
A curated list of awesome WebAuthn/FIDO2 resources
-
WebAuthn guide
-
Introduction to WebAuthn API (Yuriy Ackermann)
-
Meet Face ID and Touch ID for the web (WWDC 2020 video)
-
Meet Face ID and Touch ID for the web (Webkit blog post)
-
Web Authentication and Windows Hello
-
Enabling Strong Authentication with WebAuthn
-
Fido Alliance
-
Verifiable Credentials Data Model
-
Yubico (YubiKey)
-
Web Authentication: An API for accessing Public Key Credentials
-
-
Made by Ukraine.