{"id":15723324,"url":"https://github.com/berrysauce/passkey-demo","last_synced_at":"2025-03-12T23:33:03.529Z","repository":{"id":163609201,"uuid":"637947377","full_name":"berrysauce/passkey-demo","owner":"berrysauce","description":"🔑 WebAuthn Passkey Server Demo","archived":false,"fork":false,"pushed_at":"2023-08-31T15:02:46.000Z","size":253,"stargazers_count":4,"open_issues_count":3,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-10-30T04:30:01.307Z","etag":null,"topics":["cloudflare","honojs","passkeys","passkeys-demo","webauthn","webauthn-demo","worker"],"latest_commit_sha":null,"homepage":"https://passkeys.berrysauce.me","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/berrysauce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-08T18:52:43.000Z","updated_at":"2024-03-01T10:01:29.000Z","dependencies_parsed_at":null,"dependency_job_id":"5a81a71b-c113-4d58-9ed5-a9734fcd980a","html_url":"https://github.com/berrysauce/passkey-demo","commit_stats":{"total_commits":15,"total_committers":2,"mean_commits":7.5,"dds":0.06666666666666665,"last_synced_commit":"a8903eb16adfde41eac9cf0af102cde99b57c3e9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berrysauce%2Fpasskey-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berrysauce%2Fpasskey-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berrysauce%2Fpasskey-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/berrysauce%2Fpasskey-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/berrysauce","download_url":"https://codeload.github.com/berrysauce/passkey-demo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243148024,"owners_count":20243903,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cloudflare","honojs","passkeys","passkeys-demo","webauthn","webauthn-demo","worker"],"created_at":"2024-10-03T22:11:12.296Z","updated_at":"2025-03-12T23:33:03.473Z","avatar_url":"https://github.com/berrysauce.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1\u003e\u003cimg src=\"https://passkeys.berrysauce.me/assets/img/android-chrome-192x192.png\" alt=\"Passkey Demo Icon\" height=64\u003e\u003cbr\u003ePasskey Server Demo\u003c/h1\u003e\n\nThis is a demo login using Passkeys. Passkeys are not new, but they've gained a lot of popularity recently as big tech companies like Apple and Google have implemented them in their products. This demo simulates the registration and authentication of a user using passkeys. The server and client (user's browser) use the [Passwordless.ID WebAuthn implementation](https://github.com/passwordless-id/webauthn). Thanks to them for making such an easy-to-use library!\n\n\u003e **Warning**: I cannot guarantee your data's security. This is just a demo. The data stored on the server is just from your site-specific passkey – which shouldn't be a problem, even if an attacker gets to it. Use it at your own risk. You shouldn't use this in production.\n\n### Stack\n\n- [Server – Cloudflare Workers](https://workers.cloudflare.com/)\n- [Router – HonoJS](https://hono.dev/)\n- [Frontend – Bootstrap 5](https://getbootstrap.com/)\n\n[Cloudflare Worker JWT](https://github.com/tsndr/cloudflare-worker-jwt) (a very cool library!) is used for the server-side JWT implementation. I also recommend taking a look at [HonoJS](https://hono.dev/). It's a small but powerful router which works with Cloudflare Workers. There's still some work to do with the documentation, but that's ok, as it's quite fresh. It's really great and easy to use.\n\n### How it works\n\nThe Passwordless.ID repository has a very nice graphic for how the WebAuthn process works. I'll just copy it here:\n\n\u003cimg src=\"https://passwordless.id/protocols/webauthn/overview.svg\" alt=\"Graphic explaining the WebAuthn process\"\u003e\n\n\u003csub\u003eSource: [Passwordless.ID WebAuthn Repository](https://github.com/passwordless-id/webauthn)\u003c/sub\u003e\n\n### Development\n\nFirst, clone the repo to your machine and install all dependencies.\n~~Then, run the local development server. Some features might not work in local development mode.~~ \n\n\u003e **Note**: It seems like the WebAuthn spec requires valid SSL certificates. Currently, local development mode doesn't work. I recommend using `wrangler tail` to get the live logs from your active Cloudflare Worker instance for debugging.\n\n```\nnpm install\nnpm run dev\n```\n\nYou also need to create a file called `.dev.vars` in the project directory with the following content:\n\n```\nJWT_TOKEN=\u003cRANDOM TOKEN HERE FOR JWT SIGNING\u003e\n```\n\nAdditionally, you need to pass the `JWT_TOKEN` onto your active Worker instance via wrangler (more on that [here](https://developers.cloudflare.com/workers/platform/environment-variables/#add-secrets-to-your-project)).\n\nNow, create a `wrangler.toml` file (or edit your existing one) to match the following:\n\n```toml\nname = \"passkey-demo\"\nmain = \"src/index.ts\"\ncompatibility_date = \"2023-01-01\"\nkv_namespaces = [\n  { binding = \"DB\", id = \"YOUR_KV_ID\", preview_id = \"YOUR_PREVIEW_KV_ID\" }\n]\n\n[site]\nbucket = \"./static\"\n```\n\nDeploy your passkey application as a Cloudflare Worker via wrangler with the following command.\n\n```\nnpm run deploy\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberrysauce%2Fpasskey-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fberrysauce%2Fpasskey-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fberrysauce%2Fpasskey-demo/lists"}