-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
822 additions
and
1,552 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Next.js | ||
NEXT_TELEMETRY_DISABLED=1 | ||
|
||
NEXT_PUBLIC_CLIENT_ORIGIN=http://localhost:3000 | ||
# NEXT_PUBLIC_CLIENT_ORIGIN=https://14e5-2a07-b242-101a-9700-15d2-5b2c-c72c-ab56.ngrok-free.app | ||
|
||
NEXT_PUBLIC_FIREBASE_API_KEY="" | ||
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN="" | ||
NEXT_PUBLIC_FIREBASE_PROJECT_ID= "" | ||
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET="" | ||
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID="" | ||
NEXT_PUBLIC_FIREBASE_APP_ID="" | ||
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID="" | ||
|
||
# Sentry | ||
NEXT_PUBLIC_DEV_SENTRY_DISABLED=true | ||
# NEXT_PUBLIC_SENTRY_DSN="" | ||
# SENTRY_ORG="" | ||
# SENTRY_PROJECT="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FIREBASE_PROJECT_ID="" | ||
FIREBASE_PRIVATE_KEY="" | ||
FIREBASE_CLIENT_EMAIL="" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Passkeys with SimpleWebAuthn & Firebase | ||
|
||
- Creating (user registration), retrieving (user login), linking, removing of 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. | ||
|
||
## Development | ||
|
||
### How to start it locally? | ||
|
||
Assuming you've already finished [those steps in the main README](../../README.md), let's proceed: | ||
|
||
1. Setup Firebase: | ||
|
||
1. Create a new Firebase project | ||
|
||
2. Copy `.env.template.local` to `.env.local`: | ||
|
||
- Fill up all those `NEXT_PUBLIC_FIREBASE_` env. vars. | ||
|
||
3. 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. | ||
|
||
4. Don't forget to add `localhost` as Authorized domain in Firebase: | ||
|
||
- Firebase > Authentication > Settings > Authorised domains. | ||
|
||
5. Create a Firebase firestore database | ||
|
||
2. Run `yarn dev` and checkout `http://localhost:3000` URL. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ export const RegisterWithPasskey = () => { | |
schema={registerFormSchema} | ||
defaultValues={{ | ||
// Some some random email to make it easier for demo users | ||
email: 'some.[email protected]', | ||
email: `user${Math.floor(Math.random() * 1e3)}@gmail.com`, | ||
}} | ||
onSubmit={registerPasskey} | ||
> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
{ | ||
"name": "with-webauthn", | ||
"description": "A project with full-stack WebAuthn API examples.", | ||
"packageManager": "[email protected]", | ||
"private": true, | ||
"type": "commonjs", | ||
|
@@ -32,5 +33,17 @@ | |
"husky": "9.1.6", | ||
"turbo": "2.1.3" | ||
}, | ||
"prettier": "@tooling/prettier/config" | ||
"prettier": "@tooling/prettier/config", | ||
"license": "GPL-3.0-only", | ||
"author": { | ||
"name": "Jiří Čermák" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/cermakjiri/with-webauthn" | ||
}, | ||
"homepage": "https://with-webauthn.dev", | ||
"bugs": { | ||
"url": "https://github.com/cermakjiri/with-webauthn/issues" | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.