yubikey_otp

Yubikey OTP

Pure Nim score 15/100 · tests present · no docs generated

Summary

Latest Version 0.1.3
License MIT
CI Status Failing
Downloads 0
Last Indexed 2026-07-21 05:26

Tags

Authors

  • ThomasTJdev

Installation

nimble install yubikey_otp
choosenim install yubikey_otp
git clone https://github.com/ThomasTJdev/nim_yubikey_otp

OS Compatibility

Platform Linux macOS Windows FreeBSD OpenBSD NetBSD Android iOS WASM Embedded
yubikey_otp - - - - - - -

Dependencies

Package Version Optional
nim >= 1.6.18 No

Source

Repository https://github.com/ThomasTJdev/nim_yubikey_otp
Homepage https://github.com/ThomasTJdev/nim_yubikey_otp
Registry Source nimble_official

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

  let
    clientID = <clientID from step 1>
    otp = <users otp from yubikey>

  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

  let
    clientID = <clientID from step 1>
    publicID = <users publicID from registration>
    otp = <users otp from yubikey>

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