File: otp_custom.rs

package info (click to toggle)
rust-yubico 0.11.0-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 224 kB
  • sloc: makefile: 2
file content (16 lines) | stat: -rw-r--r-- 381 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
extern crate yubico;

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

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),
    }
}