{"id":19946760,"url":"https://github.com/privacyidea/webauthn-demo","last_synced_at":"2026-04-11T17:04:10.631Z","repository":{"id":47818348,"uuid":"276135011","full_name":"privacyidea/webauthn-demo","owner":"privacyidea","description":"Example project, showing how to authenticate against privacyIDEA using WebAuthn","archived":false,"fork":false,"pushed_at":"2022-10-20T13:05:48.000Z","size":70,"stargazers_count":1,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-10-02T05:47:07.887Z","etag":null,"topics":["2fa","authentication","express","expressjs","mfa","node","nodejs","opensource","two-factor","two-factor-authentication","webauthn","webauthn-demo"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/privacyidea.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}},"created_at":"2020-06-30T15:14:49.000Z","updated_at":"2023-06-08T07:48:56.000Z","dependencies_parsed_at":"2023-01-20T09:00:37.682Z","dependency_job_id":null,"html_url":"https://github.com/privacyidea/webauthn-demo","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/privacyidea/webauthn-demo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privacyidea%2Fwebauthn-demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privacyidea%2Fwebauthn-demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privacyidea%2Fwebauthn-demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privacyidea%2Fwebauthn-demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/privacyidea","download_url":"https://codeload.github.com/privacyidea/webauthn-demo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/privacyidea%2Fwebauthn-demo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286013524,"owners_count":27270816,"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","status":"online","status_checked_at":"2025-11-23T02:00:06.149Z","response_time":135,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["2fa","authentication","express","expressjs","mfa","node","nodejs","opensource","two-factor","two-factor-authentication","webauthn","webauthn-demo"],"created_at":"2024-11-13T00:32:23.080Z","updated_at":"2025-11-23T20:14:30.982Z","avatar_url":"https://github.com/privacyidea.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# webauthn-demo\n\nExample project, showing how to authenticate against privacyIDEA using WebAuthn.\n\n**Important: This is a demo. Many things are simplified. Please carefully review the comments labeled FIXME\nbefore building implementation based on this yourself. DO NOT USE THIS CODE IN A PRODUCTION ENVIRONMENT!**\n\n## Getting the code\n\nTo fetch this repository, simply run the following:\n\n```\n$ git clone --recursive https://github.com/privacyidea/privacyidea.git\n```\n\n**Important: Please note the `--recursive` flag used above. It is needed to fetch the `webauthn-client`, which resides\nin a submodule. Without this option, the code will not work!**\n\nIf you checked out this repository a while ago, and want to get the newest changes from upstream, you can run:\n\n```\n$ git pull --recurse-submodules\n```\n\n## Configuration\n\nYou will have to configure this code with the hostname and port of your privacyIDEA installation, by either passing\nthe options in the environment, or putting them in a file named `.env`. See `example.env` for details.\n\n## Running it\n\nTo run the server, simply type:\n\n```\n$ npm start\n```\n\nA webserver will come up on port `:3000` (unless configured otherwise), and allow you to test WebAuthn functionality in\nprivacyIDEA. Please make sure to connect using HTTPs, as a secure origin is required for WebAuthn to work. Self-signed\ncertificates are used for the purposes of this demo, so you will have to bypass a certificate security warning in your\nbrowser.\n\n## Using the example\n\nOnce you have enrolled yourself a WebAuthn-token in privacyIDEA, you can sign in with that token by simply entering the\nname of the user the token has been enrolled for, along with the PIN for the token you want to sign with. If everything\nworks correctly, you will be asked to confirm the authentication with your token. Afterward, you will be rewarded\nwith a green success message, and some info about your logged in user, confirming the authentication succeeded. If\nsomething goes wrong, an error message will appear telling you what happened.\n\n## Diving into the code\n\nThe amount of files in this repository may seem daunting at first glance, so this section exists to give you an idea of\nwhere to start reading. The most important part is the client-side implementation contained in\n`public/javascripts/script.js`. It makes use of `window.pi_webauthn.sign()`, a function provided by `pi-webauthn.js`,\nthe privacyIDEA [webauthn-client](https://github.com/privacyidea/webauthn-client). Remember to load this file in your\nown project before trying to use this function.\n\nThe server-side part of this project is written in node.js. However, since this is a minimal example, the job of the\nserver is really just to pass through the requests from the client on to the privacyIDEA server, so there is no need to\nworry if you are not familiar with node.js. The code is very simple and will be easy to comprehend, even if you have\nonly used JavaScript on the client until now. You can simply ignore anything except `routes/validate/check.js`, which\nhandles the communication with the privacyIDEA-server. It is a small file and extensively commented, to make sure it is\npossible to understand what is going on without even needing to look at the code at all.\n\n## Getting help\n\nIf you feel lost, there is extensive documentation on using privacyIDEA with WebAuthn on\n[ReadTheDocs](https://privacyidea.readthedocs.io). If you still need help, you can also ask around on the\n[privacyIDEA community forums](https://community.privacyidea.org).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivacyidea%2Fwebauthn-demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprivacyidea%2Fwebauthn-demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprivacyidea%2Fwebauthn-demo/lists"}