{"id":23359796,"url":"https://github.com/firehed/u2f-php-examples","last_synced_at":"2025-06-16T11:08:25.191Z","repository":{"id":138435435,"uuid":"54430407","full_name":"Firehed/u2f-php-examples","owner":"Firehed","description":"Examples to go along with the U2F-PHP library","archived":false,"fork":false,"pushed_at":"2021-12-22T17:58:16.000Z","size":50,"stargazers_count":7,"open_issues_count":2,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-16T11:08:23.098Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Firehed.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"publiccode":null,"codemeta":null}},"created_at":"2016-03-21T23:32:12.000Z","updated_at":"2025-05-28T00:09:21.000Z","dependencies_parsed_at":null,"dependency_job_id":"a0e13766-2da9-4850-ab85-3689e5298718","html_url":"https://github.com/Firehed/u2f-php-examples","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Firehed/u2f-php-examples","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fu2f-php-examples","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fu2f-php-examples/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fu2f-php-examples/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fu2f-php-examples/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Firehed","download_url":"https://codeload.github.com/Firehed/u2f-php-examples/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Firehed%2Fu2f-php-examples/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260148388,"owners_count":22965912,"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":[],"created_at":"2024-12-21T11:11:58.853Z","updated_at":"2025-06-16T11:08:25.167Z","avatar_url":"https://github.com/Firehed.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# U2F-PHP Examples\n\nThis is a simple demo application that goes along with [firehed/u2f-php](https://github.com/Firehed/u2f-php).\n\n## Live Demo\n[https://u2f.ericstern.com](https://u2f.ericstern.com)\n\n## Requirements\n\nSince this demo is showing off authentication with the `fido-u2f` protocol of WebAuthn, you must physically have a FIDO U2F Token.\nYou can get one [from Amazon](http://www.amazon.com/s/ref=nb_sb_noss?url=search-alias%3Daps\u0026field-keywords=u2f) for as little as $6.\nIf you have a YubiKey, that will work.\n\n## What it shows\n\nThe pages linked from [`index.html`](public/index.html) individually show what would happen during user registration and adding a token to a user's account.\nYou should step through them in order, preferably with your browser's web inspector open.\n\nThe first two pages are a standard user registration flow, and are mechanically necessary for the demo but don't add much.\n`add_token.html` and the matching PHP files demonstrate generating a challenge to send to the user, verifying their signed response, and storing the registration.\n`verify.html` and the matching PHP files demonstrate generating challenges for the user's registered devices and verifying their signed response to update their session to two-factor level.\n\nIt's a very 2004-era \"upload with FTP and you're done\" approach, so that you can focus on understanding the pairs of \"generate request\"/\"process response\" endpoints.\n\n## What it doesn't show\n\nThis is intended to be a very simple example, doing the least amount possible to demonstrate how to use the U2F library.\nThat means it intentionally leaves out best practices you would expect in a larger application: routers, models, DBALs, dependency inversion containers, etc.\n\nIn a real application, each of the php files would be some sort of standard controller, API endpoint, etc.\n\n## Notes\n\nIf you're trying to run the example locally, you must do a few things:\n\n1. `composer install`\n2. `php -S 0.0.0.0:8000 -t public/`\n3. Visit `http://localhost:8080` in any browser that [supports WebAuthn](https://developer.mozilla.org/en-US/docs/Web/API/Web_Authentication_API#browser_compatibility)\n\nNote that the Web Authentition APIs *only* work in \"secure contexts\", which means that to run it anywhere other than `localhost`, you *must* use HTTPS.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirehed%2Fu2f-php-examples","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffirehed%2Fu2f-php-examples","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffirehed%2Fu2f-php-examples/lists"}