{"id":13800627,"url":"https://github.com/tauri-apps/tauri-plugin-authenticator","last_synced_at":"2025-10-28T04:03:51.903Z","repository":{"id":40308349,"uuid":"339785347","full_name":"tauri-apps/tauri-plugin-authenticator","owner":"tauri-apps","description":"[READ ONLY] This repository is a mirror, for issue tracking and development head to: https://github.com/tauri-apps/plugins-workspace","archived":false,"fork":false,"pushed_at":"2024-09-03T08:03:04.000Z","size":1187,"stargazers_count":87,"open_issues_count":0,"forks_count":7,"subscribers_count":14,"default_branch":"v1","last_synced_at":"2024-10-29T15:44:12.107Z","etag":null,"topics":["2fa","tauri-plugin","yubikey"],"latest_commit_sha":null,"homepage":"https://github.com/tauri-apps/plugins-workspace","language":"Rust","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tauri-apps.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.spdx","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":"2021-02-17T16:28:03.000Z","updated_at":"2024-09-11T19:31:39.000Z","dependencies_parsed_at":"2024-01-07T03:40:16.599Z","dependency_job_id":"3a9ec7a7-c36c-48b3-b131-e7db8a88e718","html_url":"https://github.com/tauri-apps/tauri-plugin-authenticator","commit_stats":{"total_commits":27,"total_committers":4,"mean_commits":6.75,"dds":"0.40740740740740744","last_synced_commit":"91a15a594cc901900c13ab821d9d1727b8720c50"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-plugin-authenticator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-plugin-authenticator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-plugin-authenticator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tauri-apps%2Ftauri-plugin-authenticator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tauri-apps","download_url":"https://codeload.github.com/tauri-apps/tauri-plugin-authenticator/tar.gz/refs/heads/v1","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240802905,"owners_count":19860085,"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":["2fa","tauri-plugin","yubikey"],"created_at":"2024-08-04T00:01:14.546Z","updated_at":"2025-10-28T04:03:46.860Z","avatar_url":"https://github.com/tauri-apps.png","language":"Rust","funding_links":["https://opencollective.com/tauri"],"categories":["Rust","Development"],"sub_categories":["Plugins"],"readme":"![plugin-authenticator](https://github.com/tauri-apps/plugins-workspace/raw/v1/plugins/authenticator/banner.png)\r\n\r\nUse hardware security-keys in your Tauri App.\r\n\r\n## Install\r\n\r\n_This plugin requires a Rust version of at least **1.67**_\r\n\r\nThere are three general methods of installation that we can recommend.\r\n\r\n1. Use crates.io and npm (easiest and requires you to trust that our publishing pipeline worked)\r\n2. Pull sources directly from Github using git tags / revision hashes (most secure)\r\n3. Git submodule install this repo in your tauri project and then use the file protocol to ingest the source (most secure, but inconvenient to use)\r\n\r\nInstall the authenticator plugin by adding the following lines to your `Cargo.toml` file:\r\n\r\n`src-tauri/Cargo.toml`\r\n\r\n```toml\r\n[dependencies]\r\ntauri-plugin-authenticator = \"0.1\"\r\n# or through git\r\ntauri-plugin-authenticator = { git = \"https://github.com/tauri-apps/plugins-workspace\", branch = \"v1\" }\r\n```\r\n\r\nYou can install the JavaScript Guest bindings using your preferred JavaScript package manager:\r\n\r\n\u003e Note: Since most JavaScript package managers are unable to install packages from git monorepos we provide read-only mirrors of each plugin. This makes installation option 2 more ergonomic to use.\r\n\r\n```sh\r\npnpm add https://github.com/tauri-apps/tauri-plugin-authenticator#v1\r\n# or\r\nnpm add https://github.com/tauri-apps/tauri-plugin-authenticator#v1\r\n# or\r\nyarn add https://github.com/tauri-apps/tauri-plugin-authenticator#v1\r\n```\r\n\r\n## Usage\r\n\r\nFirst, you need to register the authenticator plugin with Tauri:\r\n\r\n`src-tauri/src/main.rs`\r\n\r\n```rust\r\nfn main() {\r\n    tauri::Builder::default()\r\n        .plugin(tauri_plugin_authenticator::init())\r\n        .run(tauri::generate_context!())\r\n        .expect(\"error while running tauri application\");\r\n}\r\n```\r\n\r\nAfterwards, all the plugin's APIs are available through the JavaScript guest bindings:\r\n\r\n```javascript\r\nimport { Authenticator } from \"tauri-plugin-authenticator-api\";\r\n\r\nconst auth = new Authenticator();\r\nauth.init(); // initialize transports\r\n\r\n// generate a 32-bytes long random challenge\r\nconst arr = new Uint32Array(32);\r\nwindow.crypto.getRandomValues(arr);\r\nconst b64 = btoa(String.fromCharCode.apply(null, arr));\r\n// web-safe base64\r\nconst challenge = b64.replace(/\\+/g, \"-\").replace(/\\//g, \"_\");\r\n\r\nconst domain = \"https://tauri.app\";\r\n\r\n// attempt to register with the security key\r\nconst json = await auth.register(challenge, domain);\r\nconst registerResult = JSON.parse(json);\r\n\r\n// verify the registration was successful\r\nconst r2 = await auth.verifyRegistration(\r\n  challenge,\r\n  app,\r\n  registerResult.registerData,\r\n  registerResult.clientData,\r\n);\r\nconst j2 = JSON.parse(r2);\r\n\r\n// sign some data\r\nconst json = await auth.sign(challenge, app, keyHandle);\r\nconst signData = JSON.parse(json);\r\n\r\n// verify the signature again\r\nconst counter = await auth.verifySignature(\r\n  challenge,\r\n  app,\r\n  signData.signData,\r\n  clientData,\r\n  keyHandle,\r\n  pubkey,\r\n);\r\n\r\nif (counter \u0026\u0026 counter \u003e 0) {\r\n  console.log(\"SUCCESS!\");\r\n}\r\n```\r\n\r\n## Contributing\r\n\r\nPRs accepted. Please make sure to read the Contributing Guide before making a pull request.\r\n\r\n## Partners\r\n\r\n\u003ctable\u003e\r\n  \u003ctbody\u003e\r\n    \u003ctr\u003e\r\n      \u003ctd align=\"center\" valign=\"middle\"\u003e\r\n        \u003ca href=\"https://crabnebula.dev\" target=\"_blank\"\u003e\r\n          \u003cimg src=\"https://github.com/tauri-apps/plugins-workspace/raw/v1/.github/sponsors/crabnebula.svg\" alt=\"CrabNebula\" width=\"283\"\u003e\r\n        \u003c/a\u003e\r\n      \u003c/td\u003e\r\n    \u003c/tr\u003e\r\n  \u003c/tbody\u003e\r\n\u003c/table\u003e\r\n\r\nFor the complete list of sponsors please visit our [website](https://tauri.app#sponsors) and [Open Collective](https://opencollective.com/tauri).\r\n\r\n## License\r\n\r\nCode: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.\r\n\r\nMIT or MIT/Apache 2.0 where applicable.\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftauri-apps%2Ftauri-plugin-authenticator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftauri-apps%2Ftauri-plugin-authenticator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftauri-apps%2Ftauri-plugin-authenticator/lists"}