libraries:
read: yubico
If you want to be strict about the hardware provenance
prefer: no attestation
read: yubico
choose valid authenicator types
prefer: cross platform
read: yubico
first factor / usernameless auth
limited space on keys
prefer: false
read: yubico
test for user identity: ask user for PIN, equivalent to password in MFA
prefer: discouraged when combined with username/password
1wan, err := webauthn.New(&webauthn.Config{
2 RPDisplayName: "Display Name",
3 RPID: "localhost",
4 RPOrigin: "http://localhost",
5 AttestationPreference: protocol.PreferNoAttestation,
6 AuthenticatorSelection: protocol.AuthenticatorSelection{
7 AuthenticatorAttachment: protocol.CrossPlatform,
8 RequireResidentKey: Bool(false),
9 UserVerification: protocol.VerificationPreferred,
10 },
11})
2 part registration / login flow,
with duo-labs/webauthn
1// Registration handler 1
2ca, sd, err := wan.BeginRegistration(user)
3// send ca to client
4// save sd to session store
5
6// Registration handler 2
7cred, err := wan.FinishRegistration(user, sd, r)
1// Login handler 1
2ca, sd, err := wan.BeginLogin(user)
3// send ca to client
4// save sd to session store
5
6// Login handler 2
7cred, err := wan.FinishLogin(user, sd, r)