yubi_opt

Crates.ioyubi_opt
lib.rsyubi_opt
version0.2.0
sourcesrc
created_at2023-01-26 19:17:22.515791
updated_at2023-01-27 21:58:23.814036
descriptionAn easy to use Yubico OTPs implementation.
homepage
repositoryhttps://github.com/Alex1607/yubico_otp
max_upload_size
id768804
size15,444
Alexander (Alex1607)

documentation

README

Rust YubicoOTP

This crate allows you to verify Yubico OTPs. To get details about what a Yubico OTP is you can read about it here: https://developers.yubico.com/OTP/

In order to use this crate you should first check the OTP of the user with the is_valid_otp function. If the OTP has the correct format you can send the OTP to Yubico for verification. To do that you will have to create a YubicoClient with your credentials. You can then call the verify function on it to send the request. Check if the result has the state Ok, if its any other state the OTP is invalid!

In case the state was Ok you will probably also want to check the public id of the key to compare it against the one you have on record. To get the public id of any OTP you can call the get_public_id function.

Commit count: 11

cargo fmt