All Projects → tauri-apps → tauri-plugin-authenticator

tauri-apps / tauri-plugin-authenticator

Licence: Apache-2.0, MIT licenses found Licenses found Apache-2.0 LICENSE_APACHE-2.0 MIT LICENSE_MIT
An official Tauri plugin for using a yubikey in your Tauri App

Programming Languages

rust
11053 projects
javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to tauri-plugin-authenticator

Yubikey Full Disk Encryption Secure Boot Uefi
Tutorial to create full disk encryption with YubiKey, encrypted boot partition and secure boot with UEFI
Stars: ✭ 62 (+47.62%)
Mutual labels:  yubikey, 2fa
Authelia
The Single Sign-On Multi-Factor portal for web apps
Stars: ✭ 11,094 (+26314.29%)
Mutual labels:  yubikey, 2fa
ucsf-vpn
Linux command-line client to manage a UCSF VPN connection
Stars: ✭ 30 (-28.57%)
Mutual labels:  yubikey, 2fa
Yubikey Manager Qt
Cross-platform application for configuring any YubiKey over all USB interfaces.
Stars: ✭ 137 (+226.19%)
Mutual labels:  yubikey, 2fa
totp.js
Time-based One-time Password Algorithm By Javascript
Stars: ✭ 26 (-38.1%)
Mutual labels:  2fa
Nginx Sso
SSO authentication provider for the auth_request nginx module
Stars: ✭ 195 (+364.29%)
Mutual labels:  yubikey
Multiotp
multiOTP open source strong two factor authentication PHP library, OATH certified, with TOTP, HOTP, Mobile-OTP, YubiKey, SMS, QRcode provisioning, etc.
Stars: ✭ 173 (+311.9%)
Mutual labels:  yubikey
Piv Go
Keys and certificates for YubiKeys, written in Go
Stars: ✭ 172 (+309.52%)
Mutual labels:  yubikey
AspNetCoreBackChannelLogout
ASP.NET Core Back-Channel Logout for Hybrid Clients, Redis, Key Vault, Azure
Stars: ✭ 17 (-59.52%)
Mutual labels:  2fa
yubikey
PHP library to interface with the Yubikey REST API
Stars: ✭ 68 (+61.9%)
Mutual labels:  yubikey
crotp
CrOTP - One Time Passwords for Crystal
Stars: ✭ 62 (+47.62%)
Mutual labels:  2fa
Go Ykpiv
Golang interface to manage Yubikeys, including a crypto.Signer & crypto.Decrypter interface
Stars: ✭ 196 (+366.67%)
Mutual labels:  yubikey
mitome.in
Explore OpenPGP and other cryptography as an alternative for seals (mitome-in)
Stars: ✭ 30 (-28.57%)
Mutual labels:  yubikey
Yubioath Android
Yubico Authenticator for Android
Stars: ✭ 176 (+319.05%)
Mutual labels:  yubikey
SimpleTOTP
A highly configurable yet simple to use TOTP based two-factor authentication processing module for SimpleSAMLphp.
Stars: ✭ 16 (-61.9%)
Mutual labels:  2fa
Yubico Piv Tool
Command line tool for the YubiKey PIV application
Stars: ✭ 172 (+309.52%)
Mutual labels:  yubikey
Libfido2
Provides library functionality for FIDO 2.0, including communication with a device over USB.
Stars: ✭ 244 (+480.95%)
Mutual labels:  yubikey
Lam
LDAP Account Manager
Stars: ✭ 223 (+430.95%)
Mutual labels:  yubikey
Python Fido2
Provides library functionality for FIDO 2.0, including communication with a device over USB.
Stars: ✭ 222 (+428.57%)
Mutual labels:  yubikey
cerebro-pass
Cerebro plugin for pass.
Stars: ✭ 15 (-64.29%)
Mutual labels:  2fa

plugin-authenticator

Use hardware security-keys in your Tauri App.

Install

There are three general methods of installation that we can recommend.

  1. Use crates.io and npm (easiest, and requires you to trust that our publishing pipeline worked)
  2. Pull sources directly from Github using git tags / revision hashes (most secure)
  3. Git submodule install this repo in your tauri project and then use file protocol to ingest the source (most secure, but inconvenient to use)

Install the Core plugin by adding the following to your Cargo.toml file:

src-tauri/Cargo.toml

[dependencies]
tauri-plugin-authenticator = "0.1"
# or through git
tauri-plugin-authenticator = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "dev" }

You can install the JavaScript Guest bindings using your preferred JavaScript package manager:

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.

pnpm add https://github.com/tauri-apps/tauri-plugin-authenticator
# or
npm add https://github.com/tauri-apps/tauri-plugin-authenticator
# or
yarn add https://github.com/tauri-apps/tauri-plugin-authenticator

Usage

First you need to register the core plugin with Tauri:

src-tauri/src/main.rs

fn main() {
    tauri::Builder::default()
        .plugin(tauri_plugin_authenticator::init())
        .run(tauri::generate_context!())
        .expect("error while running tauri application");
}

Afterwards all the plugin's APIs are available through the JavaScript guest bindings:

import { Authenticator } from "tauri-plugin-authenticator-api";

const auth = new Authenticator();
auth.init(); // initialize transports

// generate a 32-bytes long random challenge
const arr = new Uint32Array(32);
window.crypto.getRandomValues(arr);
const b64 = btoa(String.fromCharCode.apply(null, arr));
// web-safe base64
const challenge = b64.replace(/\+/g, "-").replace(/\//g, "_");

const domain = "https://tauri.app";

// attempt to register with the security key
const json = await auth.register(challenge, domain);
const registerResult = JSON.parse(json);

// verify te registration was successfull
const r2 = await auth.verifyRegistration(
  challenge,
  app,
  registerResult.registerData,
  registerResult.clientData
);
const j2 = JSON.parse(r2);

// sign some data
const json = await auth.sign(challenge, app, keyHandle);
const signData = JSON.parse(json);

// verify the signature again
const counter = await auth.verifySignature(
  challenge,
  app,
  signData.signData,
  clientData,
  keyHandle,
  pubkey
);

if (counter && counter > 0) {
  console.log("SUCCESS!");
}

Contributing

PRs accepted. Please make sure to read the Contributing Guide before making a pull request.

License

Code: (c) 2015 - Present - The Tauri Programme within The Commons Conservancy.

MIT or MIT/Apache 2.0 where applicable.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].