An open API service indexing awesome lists of open source software.

https://github.com/thomastjdev/nim_yubikey_otp


https://github.com/thomastjdev/nim_yubikey_otp

Last synced: 15 days ago
JSON representation

Awesome Lists containing this project

README

          

# yubikey_otp

For general information see:
* https://developers.yubico.com/OTP/OTP_Walk-Through.html
* https://developers.yubico.com/yubikey-val/Validation_Protocol_V2.0.html
* https://docs.yubico.com/yesdk/users-manual/application-otp/yubico-otp.html
* https://upgrade.yubico.com/getapikey/

This is a simple api call and validator for the yubikey's OTP.

## 1. Set up

Go to `https://upgrade.yubico.com/getapikey/` and get an API key. Save the
clientID.

## 2. Register user on

```nim
let
clientID =
otp =

let
data = yubikeyRegister(clientID, otp)

if data.success:
# Save the `data.publicID` to the database and associate it with the user
else:
# Handle the error
```

## 3. Validate on login

```nim
let
clientID =
publicID =
otp =

if yubikeyValidate(clientID, publicID, otp):
# Success
else:
# Failure
```