All Projects → wisespace-io → yubico-rs

wisespace-io / yubico-rs

Licence: other
Yubikey client API library, Challenge-Response & Configuration

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to yubico-rs

multiOTPCredentialProvider
multiOTP Credential Provider is a V2 Credential Provider for Windows 7/8/8.1/10/2012(R2)/2016 with options like RDP only and UPN name support
Stars: ✭ 121 (+210.26%)
Mutual labels:  otp, yubikey, yubico-otp
Glewlwyd
Single Sign On server, OAuth2, Openid Connect, multiple factor authentication with, HOTP/TOTP, FIDO2, TLS Certificates, etc. extensible via plugins
Stars: ✭ 292 (+648.72%)
Mutual labels:  otp, yubikey
Yubikey Manager Qt
Cross-platform application for configuring any YubiKey over all USB interfaces.
Stars: ✭ 137 (+251.28%)
Mutual labels:  otp, 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 (+343.59%)
Mutual labels:  otp, yubikey
Yubikey Manager
Python library and command line tool for configuring any YubiKey over all USB interfaces.
Stars: ✭ 351 (+800%)
Mutual labels:  otp, yubikey
yubitell
Silently extract a YubiKey serial number
Stars: ✭ 15 (-61.54%)
Mutual labels:  otp, yubikey
openconnect-gui-menu-bar
OpenConnect Menu Bar - Connect/Disconnect/Status - for Mac OS X (supports Duo push/sms/phone, or Yubikey, Google Authenticator, Duo, or any TOTP)
Stars: ✭ 56 (+43.59%)
Mutual labels:  yubikey
otp-view
OTP View
Stars: ✭ 32 (-17.95%)
Mutual labels:  otp
arduino-yksim
Simulate Yubikey with Arduino Leonardo
Stars: ✭ 61 (+56.41%)
Mutual labels:  yubikey
clojang
Clojure API for Erlang/OTP Communications (built on jiface)
Stars: ✭ 61 (+56.41%)
Mutual labels:  otp
rabbit
Build Elixir applications with RabbitMQ
Stars: ✭ 36 (-7.69%)
Mutual labels:  otp
angular-code-input
Code (number/chars/otp/password) input component for angular 7, 8, 9, 10, 11, 12+ projects including Ionic 4, 5 +
Stars: ✭ 112 (+187.18%)
Mutual labels:  otp
ios-application
A native, lightweight and secure one-time-password (OTP) client built for iOS; Raivo OTP!
Stars: ✭ 581 (+1389.74%)
Mutual labels:  otp
otp
📫 Fault tolerant multicore programs with actors
Stars: ✭ 169 (+333.33%)
Mutual labels:  otp
otp-authenticator-webapp
A 'Google Authenticator' like Single Page Application
Stars: ✭ 69 (+76.92%)
Mutual labels:  otp
e-voting-with-django
The Voting System web application using Django is a project that serves as the automated voting system of an organization or school. This system works like the common manual system of election voting system whereas this system must be populated by the list of the positions, candidates, and voters. This system can help a certain organization or s…
Stars: ✭ 54 (+38.46%)
Mutual labels:  otp
YubiGuard
Python script to prevent accidental triggering of YubiKeys on Linux.
Stars: ✭ 23 (-41.03%)
Mutual labels:  yubikey
cre
common runtime environment for distributed programming languages
Stars: ✭ 20 (-48.72%)
Mutual labels:  otp
aws-profile-gpg
🔐 ☁️ Run aws-cli commands using IAM Access Keys stored in a GPG-encrypted credentials file
Stars: ✭ 35 (-10.26%)
Mutual labels:  yubikey
age-plugin-yubikey
YubiKey plugin for age
Stars: ✭ 137 (+251.28%)
Mutual labels:  yubikey

Yubico   Build Status Latest Version MIT licensed Apache-2.0 licensed

Enables integration with the Yubico validation platform, so you can use Yubikey's one-time-password in your Rust application, allowing a user to authenticate via Yubikey.


Current features

Note: The USB-related features have been moved to a sepatated repository, yubico-manager

Usage

Add this to your Cargo.toml

[dependencies]
yubico = "0.9"

The following are a list of Cargo features that can be enabled or disabled:

  • online-tokio (enabled by default): Provides integration to Tokio using futures.

You can enable or disable them using the example below:

[dependencies.yubico]
version = "0.9"
# don't include the default features (online-tokio)
default-features = false
# cherry-pick individual features
features = []

Request your api key.

OTP with Default Servers

extern crate yubico;

use yubico::config::*;
use yubico::verify;

fn main() {
   let config = Config::default()
       .set_client_id("CLIENT_ID")
       .set_key("API_KEY");

   match verify("OTP", config) {
      Ok(answer) => println!("{}", answer),
      Err(e) => println!("Error: {}", e),
   }
}

OTP with custom API servers

extern crate yubico;

use yubico::verify;
use yubico::config::*;

fn main() {
   let config = Config::default()
       .set_client_id("CLIENT_ID")
       .set_key("API_KEY")
       .set_api_hosts(vec!["https://api.example.com/verify".into()]);

   match verify("OTP", config) {
      Ok(answer) => println!("{}", answer),
      Err(e) => println!("Error: {}", e),
   }
}

Asynchronous OTP validation

#![recursion_limit="128"]
extern crate futures;
extern crate tokio;
extern crate yubico;

use futures::future::Future;
use yubico::verify_async;
extern crate yubico;

use std::io::stdin;
use yubico::config::Config;

fn main() {
    println!("Please plug in a yubikey and enter an OTP");

    let client_id = std::env::var("YK_CLIENT_ID")
        .expect("Please set a value to the YK_CLIENT_ID environment variable.");

    let api_key = std::env::var("YK_API_KEY")
        .expect("Please set a value to the YK_API_KEY environment variable.");

    let otp = read_user_input();

    let config = Config::default()
        .set_client_id(client_id)
        .set_key(api_key);

    tokio::run(verify_async(otp, config)
        .unwrap()
        .map(|_|{
            println!("Valid OTP.");
        })
        .map_err(|err|{
            println!("Invalid OTP. Cause: {:?}", err);
        }))
}

fn read_user_input() -> String {
    let mut buf = String::new();

    stdin()
        .read_line(&mut buf)
        .expect("Could not read user input.");

    buf
}

Changelog

- 0.10.0: Upgrade to `tokio` 1.1 and `reqwest` 0.11
- 0.9.2: (Yanked) Dependencies update
- 0.9.1: Set HTTP Proxy (Basic-auth is optional)
- 0.9.0: Moving to `tokio` 0.2 and `reqwest` 0.10
- 0.9.0-alpha.1: Moving to `futures` 0.3.0-alpha.19 
- 0.8: Rename the `sync` and `async` modules to `sync_verifier` and `async_verifier` to avoid the use of the `async` reserved keyword.
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].