Web Authentication (WebAuthn)

TOC

Web Authentication API navigator.credentials

Guide to Web Authentication


const publicKeyCredentialCreationOptions = {
    challenge: Uint8Array.from(randomStringFromServer, c => c.charCodeAt(0)),
    rp: {
        name: "Duo Security",
        id: "duosecurity.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"
};

const credential = await navigator.credentials.create({
    publicKey: publicKeyCredentialCreationOptions
});

WebAuthn 硬體

SoloKeys - The first open source FIDO2 security key.

WebAuthn 參考專案

Google

Pretix 票務

pretix/pretix: Ticket shop application for conferences, festivals, concerts, tech events, shows, exhibitions, workshops, barcamps, etc.

Release 3.1.0 of pretix – pretix – Reinventing ticket sales for conferences, festivals, exhibitions, ...

WebAuthn We ported our two-factor authentication to support hardware tokens via WebAuthn instead of U2F. All your keys are still working, but they now work in Microsoft Edge, many more Firefox versions, as well as most mobile browsers, too.

pretix/webauthn.js at master · pretix/pretix

Okta SignIn widget 身份識別

Cryptovote

cryptovote/webauthn.js at master · cryptovoting/cryptovote

FIDO2/WebAuthn Resources

TODO

201909