- Creating (user registration), retrieving (user login), linking multiple, and removing passkeys.
- Issuing a JWT token via Firebase Auth once user is authenticated.
- Passkes are stored in Firebase Firestore.
- Formatting and parsing of WebAuthn API request / responses done via SimpleWebAuthn library.
Assuming you've already finished those steps in the main README, let's proceed:
-
Setup Firebase:
-
Create a new Firebase project
-
Copy
.env.template.local
to.env.local
:- Fill up all those
NEXT_PUBLIC_FIREBASE_
env. vars.
- Fill up all those
-
Copy
.env.template.server
to.env.server
:- Create a new private key in
Firebase > Project settings > Service accounts
. - Fill up all those
FIREBASE_
env. vars.
- Create a new private key in
-
Don't forget to add
localhost
as Authorized domain in Firebase:- Firebase > Authentication > Settings > Authorised domains.
-
Create a Firebase firestore database
-
-
Run
yarn dev
and checkouthttp://localhost:3000
URL.