{"id":23159209,"url":"https://github.com/jogemu/phpasskey","last_synced_at":"2026-02-16T08:33:50.818Z","repository":{"id":237679520,"uuid":"795024846","full_name":"jogemu/phpasskey","owner":"jogemu","description":"Concise passkey authentication for php with mysql.","archived":false,"fork":false,"pushed_at":"2025-10-17T17:56:25.000Z","size":28,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-10-22T01:33:03.723Z","etag":null,"topics":["mysql","passkeys","php"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"0bsd","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jogemu.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,"publiccode":null,"codemeta":null}},"created_at":"2024-05-02T12:42:15.000Z","updated_at":"2025-10-17T17:56:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"da0b78e4-4b5a-4087-a217-ca4bb1ec61e9","html_url":"https://github.com/jogemu/phpasskey","commit_stats":null,"previous_names":["jogemu/phpasskey"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jogemu/phpasskey","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogemu%2Fphpasskey","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogemu%2Fphpasskey/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogemu%2Fphpasskey/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogemu%2Fphpasskey/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jogemu","download_url":"https://codeload.github.com/jogemu/phpasskey/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jogemu%2Fphpasskey/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29503813,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-16T08:14:25.707Z","status":"ssl_error","status_checked_at":"2026-02-16T08:14:25.334Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["mysql","passkeys","php"],"created_at":"2024-12-17T22:33:04.214Z","updated_at":"2026-02-16T08:33:50.802Z","avatar_url":"https://github.com/jogemu.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# phpasskey\n\nConcise passkey authentication for php with mysql. Only uses cookies once the login process begins.\n\n## Setup\n\nCreate the following table.\n\n```sql\nCREATE TABLE `passkeys` (\n  `passkey` varbinary(32) PRIMARY KEY,\n  `alg` smallint,\n  `pub` varbinary(294),\n  `user` int,\n  `label` varchar(64)\n)\n```\n\nAdd this to the top of any php file that requires login. You can customize the login screen to your liking where the login button is echoed.\n\n```php\n\u003c?php\n\n$mySQLi = new mysqli('server', 'user', 'password', 'database'); // TODO\n(!$mySQLi-\u003econnect_error) or exit('mySQLi unable to connect');\n$mySQLi-\u003eset_charset('utf8mb4');\nregister_shutdown_function(fn() =\u003e $mySQLi-\u003eclose());\n\n(require 'phpasskey.php')(function() {\n  // Only continues if not already logged in.\n  echo '\u003cbutton onclick=\"login()\"\u003eLogin\u003c/button\u003e';\n}, $mySQLi, register: 'passkey label');\n// Only continues if the user is logged in.\necho '\u003cbutton onclick=\"register()\"\u003eRegister\u003c/button\u003e';\n```\n\nIf the above is put in a php file you can require it in other files to reuse a login screen. Passkey registration is only possible if the user is logged in and the passkey label is not omitted. You may login by setting the following session variables.\n\n```php\n\u003c?php\nsession_start();\n$_SESSION['user'] = 1;\n$_SESSION['name'] = 'John Doe';\n```\n\n## Notes\n\n* Some variables are base64 decoded just to encode them. This prevents missing base64 padding.\n* Microsoft Hello replaces `+` and `/` with `-` and `_` to allow url encoding.\n* The header of Microsoft Hello public keys is replaced with MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8A. There was an `s` instead of an `E`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjogemu%2Fphpasskey","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjogemu%2Fphpasskey","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjogemu%2Fphpasskey/lists"}